-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Raw html #517
Raw html #517
Conversation
If you have markup with embedded HTML like this some markup <div> a = b * c * d; </div> By default marked will turn that into <p>some markup</p> <div> a = b <em> c </em> d; </div> `rawHtml: true` will change that output to <p>some markup</p> <div> a = b * c * d; </div>
Not sure I"m following what this PR actually does. Closing to reduce clutter of PRs to focus on fixing issues rather than enhancements at this time. |
It says what it does right in the PR. Copied from the PR Don't look inside HTML content, just output the raw HTML as is. If you have markup with embedded HTML like this some markup
By default marked will turn that into
rawHtml: true will change that output to
If it's not clear the second snippet has no Effectively it stops looking for markup inside nested HTML |
There is not a test, unless I'm missing it to demonstrate how it will work in practice. Also, I'm not fully understanding why you would want to pass raw html into Marked - to receive exactly what you passed in. Marked exists explicitly to convert Markdown into the HTML...not take HTML and leave it alone. Tests and use cases would be helpful to this end. |
There's all kinds of reasons you might want to embed a chunk of HTML in your markdown and not have it get munged by the parser. In any case I don't know if you care but here's a commonmark example You can see it doesn't insert the https://runkit.com/greggman/5a41dc712cef4c0013920b8f Maybe that's a feature you like. For me I had complex tables/equations I needed in my markdown and marked was not able to handle them, hence this PR. |
@greggman: Thanks for the detail and example. It appears that what commonmark.js is doing is to ignore markdown within an element passed to the parser.
This will italicize the first I will put this with the mixed content ticket (#985). Again, the biggest issue with the PR is that there is no test demonstrating that the solution works (see #956). |
I don't know if you think is a good change or if I'm just not understanding something but I thought I'd pass it on