-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When using the xhtmlOut flag and the markdown-it-task-list plugin with the wrapper div option, the wrapper div is self-closed by markdown-it, so it no longer wraps the input and label, but the div's end tag is left as well, so the markup is invalid XHTML:
import MarkdownIt from "markdown-it"
import MarkdownItTaskCheckbox from "markdown-it-task-checkbox"
const xhtmlParser = MarkdownIt({
html: true,
xhtmlOut: true,
}).use(MarkdownItTaskCheckbox , { divWrap: true });
var html = xhtmlParser.render("- [ ] unchecked item 1");
console.log(html);
<ul class="task-list">
<li class="task-list-item">
<div class="checkbox" />
<input type="checkbox" id="cbx_0" disabled="true" />
<label for="cbx_0"> unchecked item 1</label>
</div>
</li>
</ul>
The MarkdownIt author quickly claimed that this is an issue with the plugin, not MarkdownIt. I'm not sure either way, as I'm not familiar enough with the plug-in API to know if your code below is calling MarkdownIt in some way that would result in this issue during XHTML output:
markdown-it-task-checkbox/index.js
Line 69 in 6c684bb
if (options.divWrap) { |
Reference to the MarkdownIt issue:
Metadata
Metadata
Assignees
Labels
No labels