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

makeMarkdown converts code to ticks even if there is formatting #932

Open
jonatanschroeder opened this issue Jul 2, 2022 · 0 comments
Open

Comments

@jonatanschroeder
Copy link

As mentioned in #400, #819, #861, and others, Markdown does not allow formatting inside code blocks (backticks). So makeHtml by design escapes any character inside it to its corresponding entity where required. However, HTML allows formatting inside code blocks (e.g., <code><em>ab</em> cd</code> would make ab italic inside the code block). The problem is that makeMarkdown just blindly converts this <code> block to backticks, even though the result is not equivalent.

I believe the correct behaviour for <code> in makeMarkdown should be to retain the <code> tag whenever there is formatting inside. Converting code to backtick in this case does not generate equivalent Markdown code. So <code>abc<code> would convert to `abc`, but <code><em>ab</em> cd</code> would remain unchanged, maybe change to <code>*ab* cd</code>.

A similar issue is with entities inside code blocks. <code>&lt;</code> in makeMarkdown should not be converted to `&lt;`, as converting that back to HTML would have a result of <code>&amp;lt;</code> instead.

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

No branches or pull requests

1 participant