projects
/
working
/
eg-antora.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7952436
)
correctly flatten command with line continuation when copying
author
Dan Allen
<dan@opendevise.com>
Sat, 12 Dec 2020 03:33:01 +0000
(20:33 -0700)
committer
Dan Allen
<dan@opendevise.com>
Sat, 12 Dec 2020 03:33:01 +0000
(20:33 -0700)
src/js/06-copy-to-clipboard.js
patch
|
blob
|
history
diff --git
a/src/js/06-copy-to-clipboard.js
b/src/js/06-copy-to-clipboard.js
index
4f4b802
..
9562dfa
100644
(file)
--- a/
src/js/06-copy-to-clipboard.js
+++ b/
src/js/06-copy-to-clipboard.js
@@
-44,7
+44,7
@@
function extractCommands (text) {
var cmdRx = /^\$ (\S[^\\\n]*(\\\n(?!\$ )[^\\\n]*)*)(?=\n|$)/gm
- var cleanupRx = /( )
? *\\\n
*/g
+ var cleanupRx = /( )
*\\\n *|\\\n( ?)
*/g
var cmds = []
var m
while ((m = cmdRx.exec(text))) cmds.push(m[1].replace(cleanupRx, '$1'))