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

Fix handling of inline HTML #28

Open
maghoff opened this issue Oct 26, 2017 · 6 comments
Open

Fix handling of inline HTML #28

maghoff opened this issue Oct 26, 2017 · 6 comments

Comments

@maghoff
Copy link
Owner

maghoff commented Oct 26, 2017

Currently pulldown-cmark parses inline HTML as HTML (in adherence to the CommonMark spec). Sausagewiki takes this HTML and reframes it as text, because inline HTML is weird.

Instead, the parser should be configured not to look for HTML in the input.

@maghoff
Copy link
Owner Author

maghoff commented Oct 28, 2017

Forked and fixed in pulldown-cmark: https://github.com/maghoff/pulldown-cmark

Upstream pull request: pulldown-cmark/pulldown-cmark#103

@maghoff
Copy link
Owner Author

maghoff commented Oct 28, 2017

See https://github.com/maghoff/sausagewiki/compare/proper_html_handling for relevant local changes

@maghoff
Copy link
Owner Author

maghoff commented Nov 29, 2017

This has now been merged to master, so master depends on this fork: https://github.com/maghoff/pulldown-cmark

Keeping this issue open to track upstream development.

@notriddle
Copy link

notriddle commented Nov 30, 2017

Why are you trying to block inline HTML, instead of using a sanitizer pass like GitHub does?

  • Inline HTML is a part of the CommonMark spec. If you allow none of it, then you're not compliant.
  • CommonMark doesn't include all of the markup types that you probably want. For example, <del>strike through</del>
  • pulldown-cmark is not designed to filter any untrusted data. In particular, it does nothing about untrusted URL schemes.

I kinda wrote an HTML sanitization library specifically because I have strong opinions on this matter:

@vi
Copy link

vi commented Dec 1, 2017

Are at least <!-- --> comments supported or also removed?

@maghoff
Copy link
Owner Author

maghoff commented Dec 2, 2017

@notriddle Thank you for bringing the security issue to my attention. The choice of markup language for the wiki is merely one of many design descisions that have gone into making Sausagewiki what it is. I find Markdown without HTML to be a good, simple markup language, while I do not find the same for Markdown with HTML. Simplicity has been a goal all along, Commonmark conformance not a goal. The alternative for Sausagewiki would not be Markdown with HTML, but rather another simple language altogether.

@vi You could try and see? ☺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants