You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:44:48 UTC
[48/50] brooklyn-docs git commit: Handle edge case with continuation
lines.
Handle edge case with continuation lines.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/90a321c5
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/90a321c5
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/90a321c5
Branch: refs/heads/0.6.0
Commit: 90a321c5cc1c3ca0b4fb5285d82f07371e047740
Parents: 1a3633f
Author: Alasdair Hodge <al...@cloudsoftcorp.com>
Authored: Mon Nov 18 12:19:47 2013 +0000
Committer: Alasdair Hodge <al...@cloudsoftcorp.com>
Committed: Mon Nov 18 12:19:47 2013 +0000
----------------------------------------------------------------------
docs/_layouts/page.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/90a321c5/docs/_layouts/page.html
----------------------------------------------------------------------
diff --git a/docs/_layouts/page.html b/docs/_layouts/page.html
index 00fc6a9..ffb6a00 100644
--- a/docs/_layouts/page.html
+++ b/docs/_layouts/page.html
@@ -47,9 +47,9 @@ $(document).ready(function() {
var txt = target.text().trim();
if (target.find('code.bash')) {
// Strip out bash prompts from the start of each line (i.e. '$' or '%' characters
- // at the very start, or immediately following any newline). Note this may screw up if
- // a continuation line (preceding line ends with '\') begins with one of those characters.
- txt = txt.replace(/(^|\n)[$%] /g, "$1");
+ // at the very start, or immediately following any newline). Correctly handles continuation
+ // lines, where a leading '$' or '%' is *not* a prompt character.
+ txt = txt.replace(/(^|[^\\]\n)[$%] /g, "$1");
}
clipboard.setText(txt);
});