-
Notifications
You must be signed in to change notification settings - Fork 863
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
preserve HTML code #288
Comments
I'm having the same issue. I'd like to embed class attributes into divs (to control what is displayed with Semantic UI), but this won't work with the implementation as it is. |
This issue effectively means this implementation of markdown is broken, as markdown is meant to allow inline HTML by design. From the man himself:
|
It seems as though this module os no longer supported. I've switched to markdown-it, which is fantastic, and even has a plugin to resolve this very issue. |
@Ratstail91 thanks for the tip, that lib allows you to enable inline html (again, strange that this isn't on by default considering the spec). Unfortunately the lib is over 5x the size (100kb minified) but I guess them's the breaks 😁 Edit: chjj/marker also preserves inline HTML by default, and is 20kb minified |
I use marked, plus code that preprocesses my markdown specifically to what I need it to do. I guess I could refactor that code into something pretty tiny that can be configured with a few terse option objects, and throw that up on npm, as it's mostly a bunch of functions that all either look for Not quite the same as "preserving all HTML" but since you typically only have very specific HTML inside markdown (markdown already covers most of the syntax) being explicit about what should be preserved is perhaps not such a crazy idea. |
This library converts HTML code inside a markdown file into "escaped" HTML code, which is pretty problematic. I don't see anything in the README that says "leave stuff of which the syntax is unknown alone" so that something like this:
converts to
Instead it ends up doing weird stuff like
<p><div className="note"></p><h2>
which is pretty bad. How does one prevent this from happening?The text was updated successfully, but these errors were encountered: