Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Parsing of mark element in "Inline HTML" test #17

Open
joewiz opened this issue Feb 13, 2022 · 0 comments
Open

[BUG] Parsing of mark element in "Inline HTML" test #17

joewiz opened this issue Feb 13, 2022 · 0 comments
Labels

Comments

@joewiz
Copy link
Member

joewiz commented Feb 13, 2022

Expected behavior

In inline HTML, inline elements like <mark> should be preserved.

Actual behavior

The elements are dropped from output.

Reproduction steps

See the pending test at https://github.com/eXist-db/exist-markdown/blob/master/test/xqs/test-suite.xqm#L346-L361.

This test takes this markdown:

A <span style="color: red;">paragraph <span style="color: green;">containing</span></span> some <mark>inline</mark> <code>HTML</code>.

With this input, the markdown:parse() function should return:

<body>
    <p>A <span style="color: red;">paragraph <span style="color: green;">containing</span></span> some <mark>inline</mark> <code>HTML</code>.</p>
</body>

The Commonmark dingus at https://spec.commonmark.org/dingus/ returns this exactly (sans the <body> wrapper, which exist-markdown uses to ensure its results are well-formed, and which users of the library would normally omit from output):

<p>A <span style="color: red;">paragraph <span style="color: green;">containing</span></span> some <mark>inline</mark> <code>HTML</code>.</p>

But it actually returns:

<body>
    <p>A <span style="color: red;">paragraph <span style="color: green;">containing</span></span> some  <code>HTML</code>.</p>
</body>

Note that the <mark>inline</mark> element was dropped from the output and replaced with an extra space character between some and <code>HTML</code>.

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="Inline HTML" class="tests:inline-html">
    <failure message="assertTrue failed." type="failure-error-code-1"/>
    <output>false</output>
</testcase>

Please provide the following

  • Java Version: n/a
  • exist-db version: 6.1.0-SNAPSHOT
  • exist-markdown version: 1.0.0
  • OS version: n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant