Open joewiz opened 2 years ago
Curly braces inside fenced code blocks should be left as literal curly braces.
Curly braces are replaced with a <span itemprop=""> element.
<span itemprop="">
See the pending test at https://github.com/eXist-db/exist-markdown/blob/master/test/xqs/test-suite.xqm#L223-L244.
This test takes this markdown:
```xquery for $i in 1 to 10 return <li>{$i * 2}</li> ```
With this input, the markdown:parse() function should return:
markdown:parse()
<body> <pre data-language="xquery">for $i in 1 to 10 return <li>{$i * 2}</li> </pre> </body>
The Commonmark dingus at https://spec.commonmark.org/dingus/ returns something quite similar, so our expectations are inline with Commonmark:
<pre> <code class="language-xquery">for $i in 1 to 10 return <li>{$i * 2}</li> </code> </pre>
But it actually returns:
<body> <pre data-language="xquery">for $i in 1 to 10 return <li><span itemprop="$i * 2">$i * 2</span></li> </pre> </body>
Note that the curly braces are transformed into a <span itemprop=""> structure - which is associated with the library's handling of "label" at https://github.com/eXist-db/exist-markdown/blob/master/content/markdown.xqm#L119-L128.
Since the parsed markdown doesn't equal the expected output, the test fails (and is marked as pending in the source until a fix is in place):
<testcase name="Code Blocks" class="tests:code-blocks"> <failure message="assertTrue failed." type="failure-error-code-1"/> <output>false</output> </testcase>
Expected behavior
Curly braces inside fenced code blocks should be left as literal curly braces.
Actual behavior
Curly braces are replaced with a
<span itemprop="">
element.Reproduction steps
See the pending test at https://github.com/eXist-db/exist-markdown/blob/master/test/xqs/test-suite.xqm#L223-L244.
This test takes this markdown:
With this input, the
markdown:parse()
function should return:The Commonmark dingus at https://spec.commonmark.org/dingus/ returns something quite similar, so our expectations are inline with Commonmark:
But it actually returns:
Note that the curly braces are transformed into a
<span itemprop="">
structure - which is associated with the library's handling of "label" at https://github.com/eXist-db/exist-markdown/blob/master/content/markdown.xqm#L119-L128.Since the parsed markdown doesn't equal the expected output, the test fails (and is marked as pending in the source until a fix is in place):
Please provide the following