[Feature] Limited support for commonly used HTML tags and entities in Markdown #1249
Open
2 tasks done
Labels
enhancement
New feature or request
Initial checklist
Problem
I'm facing an issue with preview images rendering at a huge size because the source image width is huge and AFAIK there is no way in commonmark or GFM to set a width or height. Therefore the correct display behaviour for the image plugin is to render the images AS IS. However, HTML support for Markdown is common and widely used. This limitation is breaking UX and behaviour for my current application and I'm quite sure that it's a limitation that is hindering Milkdown adoption. I couldn't find a plugin to support those HTML tags usually supported by decent Markdown editors/libraries.
Solution
It would be great if Milkdown would support the following HTML elements with limited support for attributes, exactly as it does render here:
Image
<img src="$string" width="$numeric_only" height="$numeric_only" />
rendered as:Underline
<ins>will be underlined</ins>
rendered as: will be underlinedHTML Entities and Symbols
–©
rendered as: –©Center
<p align="center">This text is centered.</p>
rendered as:
This text is centered.
Comments
Some people need the ability to write sentences in their Markdown files that will not appear in the rendered output.
[This is a comment that will be hidden.]: #
The following is hidden:
Forced Line Breaks
<br><br>
rendered asA
B
Simple Lists, also nested (in tables)
rendered as:
Table of Contents (ToC)
Rendered as:
Table of Contents
Video and Audio
[![Video alt text](https://github.com/Milkdown/milkdown/assets/454817/0270c732-7198-45a8-8f9a-a3ca70605ae1)](https://www.youtube.com/watch?v=a8CwpGARAsQ)
rendered as:
All of this, I think, can be achieved by parsing text nodes as HTML and constructing the internal AST representing the respective Nodes including the additional attributes and also re-transform it back into it's original form (serialization), right?
p.s.: Spec is highly influenced by:
https://www.markdownguide.org/hacks/
Alternatives
I'm not sure about that. Please advise.
The text was updated successfully, but these errors were encountered: