We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32d1967 commit d335894Copy full SHA for d335894
src/js/06-copy-to-clipboard.js
@@ -44,10 +44,10 @@
44
45
function extractCommands (text) {
46
var cmdRx = /^\$ (\S[^\\\n]*(\\\n(?!\$ )[^\\\n]*)*)(?=\n|$)/gm
47
- var cleanupRx = /( )? *\\\n */g
+ var cleanupRx = /( ) *\\\n *|\\\n( ?) */g
48
var cmds = []
49
var m
50
- while ((m = cmdRx.exec(text))) cmds.push(m[1].replace(cleanupRx, '$1'))
+ while ((m = cmdRx.exec(text))) cmds.push(m[1].replace(cleanupRx, '$1$2'))
51
return cmds.join(' && ')
52
}
53
0 commit comments