Skip to content

Commit

Permalink
fix copy empty line #548
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Dec 18, 2019
1 parent 640206a commit 6324c27
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -10,7 +10,7 @@ http://terminal.jcubic.pl

[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&2927582373f2249bc9be6e71a1ff3c600513d68d)](https://travis-ci.org/jcubic/jquery.terminal)
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&640206ad65434176d75f8a56ec304f0e42372ff7)](https://travis-ci.org/jcubic/jquery.terminal)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&61cd458e5a8c6d4c02575731ac378fd2)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
![downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
[![package quality](http://npm.packagequality.com/shield/jquery.terminal.svg)](http://packagequality.com/#?package=jquery.terminal)
Expand Down
9 changes: 5 additions & 4 deletions js/jquery.terminal-2.9.0.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 18 Dec 2019 11:56:23 +0000
* Date: Wed, 18 Dec 2019 12:22:00 +0000
*/
/* global location, setTimeout, window, global, sprintf, setImmediate,
IntersectionObserver, ResizeObserver, module, require, define,
Expand Down Expand Up @@ -3869,7 +3869,8 @@
}
// -----------------------------------------------------------------
function process_div(element) {
return $(element).find('> div')
// span is empty line, div is default case with text
return $(element).find('> div, > span')
.map(process_selected_line).get().join('\n').replace(/\n$/, '');
}
// -----------------------------------------------------------------
Expand All @@ -3882,7 +3883,7 @@
stdout = $html.find('div[data-index]').map(function() {
return process_div(this);
}).get().join('\n');
// match insdie single echo output
// match inside single echo output
if (!stdout && html.match(/style="width: 100%;?"/)) {
stdout = process_div($html);
}
Expand Down Expand Up @@ -4062,7 +4063,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 18 Dec 2019 11:56:23 +0000',
date: 'Wed, 18 Dec 2019 12:22:00 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.9.0.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions js/jquery.terminal-src.js
Expand Up @@ -3869,7 +3869,8 @@
}
// -----------------------------------------------------------------
function process_div(element) {
return $(element).find('> div')
// span is empty line, div is default case with text
return $(element).find('> div, > span')
.map(process_selected_line).get().join('\n').replace(/\n$/, '');
}
// -----------------------------------------------------------------
Expand All @@ -3882,7 +3883,7 @@
stdout = $html.find('div[data-index]').map(function() {
return process_div(this);
}).get().join('\n');
// match insdie single echo output
// match inside single echo output
if (!stdout && html.match(/style="width: 100%;?"/)) {
stdout = process_div($html);
}
Expand Down
9 changes: 5 additions & 4 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 18 Dec 2019 11:56:23 +0000
* Date: Wed, 18 Dec 2019 12:22:00 +0000
*/
/* global location, setTimeout, window, global, sprintf, setImmediate,
IntersectionObserver, ResizeObserver, module, require, define,
Expand Down Expand Up @@ -3869,7 +3869,8 @@
}
// -----------------------------------------------------------------
function process_div(element) {
return $(element).find('> div')
// span is empty line, div is default case with text
return $(element).find('> div, > span')
.map(process_selected_line).get().join('\n').replace(/\n$/, '');
}
// -----------------------------------------------------------------
Expand All @@ -3882,7 +3883,7 @@
stdout = $html.find('div[data-index]').map(function() {
return process_div(this);
}).get().join('\n');
// match insdie single echo output
// match inside single echo output
if (!stdout && html.match(/style="width: 100%;?"/)) {
stdout = process_div($html);
}
Expand Down Expand Up @@ -4062,7 +4063,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 18 Dec 2019 11:56:23 +0000',
date: 'Wed, 18 Dec 2019 12:22:00 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 6324c27

Please sign in to comment.