diff options
author | Matt Clegg <m@cle.gg> | 2018-09-03 11:58:02 +0200 |
---|---|---|
committer | Nico Williams <nico@cryptonector.com> | 2019-02-07 11:08:44 -0600 |
commit | 18ac789d6d74f198053c547fba4e8c70cb99d55a (patch) | |
tree | 8fb2e369d0606b8773f5ae5040c5963c87c09da7 | |
parent | 956d40d9dd7cc69227af817009ad47373e709e5f (diff) |
FIX if-then-else example
"(.+)" doesn't match new line characters so the link generated for [if-then-else](https://github.com/stedolan/jq/blob/90bc29c1b544c0436ec44246e180fdbb6d6384df/docs/content/3.manual/v1.5/manual.yml#L1804) doesn't work
-rw-r--r-- | docs/public/js/manual-search.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/public/js/manual-search.js b/docs/public/js/manual-search.js index eb7cff89..e5d6ee53 100644 --- a/docs/public/js/manual-search.js +++ b/docs/public/js/manual-search.js @@ -44,7 +44,7 @@ $(function() { $.each($('.manual-example table'), function(index, value) { $value = $(value) var j = $value.find('tr:nth-child(2) td:first').text(); - var q = $value.find('.jqprogram').text().replace(/^jq /, '').replace(/^'(.+)'$/, '$1'); + var q = $value.find('.jqprogram').text().replace(/^jq /, '').replace(/(\r\n|\n|\r)/gm," ").replace(/^'(.+)'$/, '$1'); var url = 'https://jqplay.org/jq?q=' + encodeURIComponent(q) +'&j=' + encodeURIComponent(j) var $last_tr = $value.find('tr:last'); $last_tr.after('<tr class="jqplay-btn"><th><a href="' + url + '" class="btn btn-primary btn-sm">Run</a></th><th></th></tr><tr><th></th><th></th></tr>'); |