From 61185add52a34d4e13d9a7b090f961fe6b998790 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Fri, 11 Dec 2020 20:33:01 -0700 Subject: [PATCH] correctly flatten command with line continuation when copying --- src/js/06-copy-to-clipboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/06-copy-to-clipboard.js b/src/js/06-copy-to-clipboard.js index 4f4b802..9562dfa 100644 --- 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')) -- 2.11.0