-
Notifications
You must be signed in to change notification settings - Fork 342
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
Support HTML tags in markdown #498
Comments
Our markdown parser supports html but we don't have it turned on. To me it seems pretty dangerous. Do you have a use-case that goes beyond what markdown can do? |
It's not dangerous if only some html tags and attributes are allowed.
Yes. The most common use case is a table with line breaks or horizontal lines:
HTML also allows you to create a table without a header:
Table cells spanning multiple columns or rows:
Table captions:
Image width set to 25%: Image captions: Fig. 1: The Meta logoDescription lists:
Hover titles: Hover me
Alignment: I'm far-right!
I'm in the middle!
|
Here's the code github uses for sanitizing HTML: |
We wouldn't have to do this, it's done by our front end markdown parser: https://github.com/markdown-it/markdown-it Its fairly sure its safe to turn it on, its a good library. |
It would also have to be enabled on the backend for RSS and federation. |
I don't know that anything would be required for comrak. It doesn't actually render that html and would probably leave it alone when running |
Enabling html tags in markdown. Fixes #498
Is your proposal related to a problem?
CommonMark markdown supports HTML tags. Websites usually have an allowlist of accepted tags (here's the list of tags accepted by GitHub). Since Lemmy doesn't follow the CommonMark spec, it doesn't support HTML, but I think it should, since HTML is much more flexible and powerful.
Describe the solution you'd like
Lemmy should allow HTML tags. Ideally, it should also follow the CommonMark spec as much as possible.
Describe alternatives you've considered
None.
Additional context
Official CommonMark website and playground.
The text was updated successfully, but these errors were encountered: