From: Dan Allen Date: Sat, 12 Dec 2020 03:33:01 +0000 (-0700) Subject: correctly flatten command with line continuation when copying X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=61185add52a34d4e13d9a7b090f961fe6b998790;p=working%2Feg-antora.git correctly flatten command with line continuation when copying --- 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'))