Tcl Library Source Code

View Ticket
Login
Ticket UUID: 57f151c3545e5e73a6310cf5bde01ccd1bb42051
Title: HTML block elements mistreated when used in inline markdown
Type: Bug Version: 1.2.2
Submitter: torstenberg Created on: 2022-05-05 08:37:30
Subsystem: markdown Assigned To:
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2022-05-05 12:16:14
Resolution: None Closed By: nobody
    Closed on:
Description:
Using HTML block elements such as `<div>` inline within a markdown paragraph (or on a new line but without an empty line between) will mean that the parser treats this HTML as inline elements or even mistreats the HTML tag entirely. The following tests show the wrong behaviour:

```
test div-1.3 {embedded div on a line in a paragraph} -body {
    convert {
        hello
        <div allowfullscreen></div>
        hello again
    }
} -result {
    <p>hello</p>

    <div allowfullscreen></div>

    <p>hello again</p>
}
# actual result:
# <p>hello
# &lt;div allowfullscreen&gt;</div>
# hello again</p>


test div-1.4 {embedded div with attribute on a line in a paragraph} -body {
    convert {
        hello
        <div allowfullscreen="1"></div>
        hello again
    }
} -result {
    <p>hello</p>

    <div allowfullscreen="1"></div>

    <p>hello again</p>
}
# actual result:
# <p>hello
# <div allowfullscreen="1"></div>
# hello again</p>
```
User Comments: aku added on 2022-05-05 12:16:14:

Test cases added, with commit [bf7b7ef0cc].