-
Notifications
You must be signed in to change notification settings - Fork 800
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
Markdown block: support HTML in block #11854
Comments
Just throwing my support in for this feature; I am currently maintaining two blogs with the same content to determine a preferred platform and this is a major pain-point for me. I strongly prefer writing in MD but have two very common use cases for embedding HTML in the MD block;
I maintain my content as static .md files on a private Git server, which provides a few favorable benefits; e.g. backups, offline editing, simplicity of dev environment for theme editing against my content, etc. |
Just noting that this was also reported/requested in 2019865-zen |
Since the markdown block doesn't auto-generate header IDs (#3562) and the underlying library's extras field isn't available, HTML is needed to add anchor links for an internal table of contents. |
I spoke to a WordPress.com user and developer who is disappointed that we say we support the markdown-it parser but we don't support inline HTML. Their thoughts:
I hope y'all will consider making an update to support inline HTML within the Jetpack Markdown block. |
Please enable inline HTML in Jetpack by changing
|
@aletheia7 Did you confirm that this is the only change needed? Just tried making the changed locally (I edited the compiled Do you have instructions for the workaround? |
No. The above change is located in index.js, not editor.js. Perhaps your change did not end-up in the browser? Perhaps wordpress is serving an unchanged cached copy? Verify in the browser that |
@aletheia7 Ok so I made the edit you suggested and rebuilt, following the development environment instructions. Now, the only difference I see is an added "Edit as HTML" button Upon clicking, it shows the HTML output of my markdown So, I attempt to add some more HTML while in this view Now, I get an error saying "This block contains unexpected or invalid content" If I press "resolve" or "convert", it converts the block to a full html block (no more markdown). So the above not working, I tried just entering HTML in the markdown block to see if that's supported now. I get the same as before (escaped html) So all-in-all, following those instructions only allows me to convert my block to HTML. Not embed HTML in my markdown block. |
Following up on this, to see if any of the top contributors have any thoughts? |
Just a thought: could this perhaps depend on the wp_kses() filter? Maybe HTML elements need to be enabled when going through the filter, using wp_kses_allowed_html() ? Idk just a thought jetpack/modules/markdown/easy-markdown.php Line 429 in ca30cfd
|
Any update about this issue ? I need to add html tag in my markdown but it's impossible. The workaround quoted above doesn't seem to work anymore since jetpack/extensions/blocks/markdown/index.js doesn't exist. |
This was originally reported in #11147
Ideally, the block would support inserting content in HTML as well as Markdown, as sometimes folks prefer to use HTML directly, for things that may be difficult or impossible to do with Markdown. In the example below, all links should be converted into links.
The text was updated successfully, but these errors were encountered: