micromark / common-markup-state-machine

CMSM: Common markup state machine
https://unifiedjs.com
48 stars 0 forks source link

GFM extension: tag filter #12

Closed wooorm closed 3 years ago

wooorm commented 4 years ago

Not all HTML can be created. A couple of tags are ignored.

Exhibit A:

alpha <title> bravo

<title>

<plaintext charlie="delta">

alpha bravo</p> <title> <plaintext charlie="delta"> Note that GitHub additionally filters HTML later, [with this config](https://github.com/syntax-tree/hast-util-sanitize/blob/master/lib/github.json) Also note the missing whitespace between `title` and `plaintext`, because there are no `<p>`s around it. So the tag filter doesn’t seem to ignore block HTML in this case, and let it parse as a paragraph, and then also filter the inline HTML. Instead, it has some form of an “invalid HTML” construct. </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/wooorm"><img src="https://avatars.githubusercontent.com/u/944406?v=4" />wooorm</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p><a href="https://github.com/micromark/micromark-extension-gfm-tagfilter">https://github.com/micromark/micromark-extension-gfm-tagfilter</a></p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>