File tree Expand file tree Collapse file tree 3 files changed +12
-19
lines changed
test/pure-tests/remote-queries/markdown-generation/data/interpreted-results/problem Expand file tree Collapse file tree 3 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -115,16 +115,14 @@ function generateMarkdownForCodeSnippet(
115115 ) ;
116116
117117 // Make sure there are no extra newlines before or after the <code> block:
118- if ( codeLines . length === 1 ) {
119- lines . push ( `<pre><code class="${ language } ">${ codeLines [ 0 ] } </code></pre>` ) ;
120- } else {
121- lines . push (
122- `<pre><code class="${ language } ">${ codeLines [ 0 ] } ` ,
123- ...codeLines . slice ( 1 , - 1 ) ,
124- `${ codeLines [ codeLines . length - 1 ] } </code></pre>` ,
125- ) ;
126- }
127- lines . push ( '' ) ;
118+ const codeLinesWrapped = [ ...codeLines ] ;
119+ codeLinesWrapped [ 0 ] = `<pre><code class="${ language } ">${ codeLinesWrapped [ 0 ] } ` ;
120+ codeLinesWrapped [ codeLinesWrapped . length - 1 ] = `${ codeLinesWrapped [ codeLinesWrapped . length - 1 ] } </code></pre>` ;
121+
122+ lines . push (
123+ ...codeLinesWrapped ,
124+ '' ,
125+ ) ;
128126 return lines ;
129127}
130128
Original file line number Diff line number Diff line change 137137 },
138138 "severity" : " Warning" ,
139139 "codeSnippet" : {
140- "startLine" : 7 ,
141- "endLine" : 11 ,
142- "text" : " // ## Parser utilities \n\n const literal = /^(?:'((?:\\\\ .|[^'])*?)'|\" ((?:\\\\ .|[^\" ])*?)\" )/\n pp.strictDirective = function(start) { \n for (;;) { \n "
140+ "startLine" : 9 ,
141+ "endLine" : 9 ,
142+ "text" : " const literal = /^(?:'((?:\\\\ .|[^'])*?)'|\" ((?:\\\\ .|[^\" ])*?)\" )/"
143143 },
144144 "highlightedRegion" : {
145145 "startLine" : 9 ,
Original file line number Diff line number Diff line change @@ -41,12 +41,7 @@ pp.strictDirective = function(start) {
4141
4242[ tools/tests/apps/modules/imports/links/acorn/src/parseutil.js] ( https://github.com/meteor/meteor/blob/53f3c4442d3542d3d2a012a854472a0d1bef9d12/tools/tests/apps/modules/imports/links/acorn/src/parseutil.js#L9-L9 )
4343
44- <pre ><code class =" javascript " >// ## Parser utilities
45-
46- const literal = /^(?:'((?:\\.|[^'])*?)'|"(<strong >(?:\\.|[^"])*?</strong >)")/
47- pp.strictDirective = function(start) {
48- for (;;) {
49- </code ></pre >
44+ <pre ><code class =" javascript " >const literal = /^(?:'((?:\\.|[^'])*?)'|"(<strong >(?:\\.|[^"])*?</strong >)")/</code ></pre >
5045
5146* This part of the regular expression may cause exponential backtracking on strings starting with '"' and containing many repetitions of '\! '.*
5247
You can’t perform that action at this time.
0 commit comments