-
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
HTML block parsing in consistency #236
Comments
This: <div>
## Markdown header
*Markdown header*
**Markdown header**
</div>
<script>
var nubbin;
</script> Will give you the behavior you're looking for. A block-level element needs 2 line feeds after it to be recognized as a block-level element. Block-level markdown is not allowed inside block-level inline html. The problem with your second piece of markdown was, the first The author is expected to give 2 line feeds after the closing tag of their block element. It just makes it much easier to deal with nested divs. Marked could be smarter about this at the cost of performance. I'll see if I can come up with something as performant, but smarter. It's going to actually need to keep state and set up a stack with the current element on the top (the original markdown.pl does not do this at all. try giving it some nested divs and watch what happens). |
How about Example 1? I would consider the output incorrect. I would expect anything inside an HTML block to remain untouched. |
Example 1 is correct. Only inline markdown is allowed within inline html (markdown.pl does not allow any markdown inside html, this a marked extension). I'd recommend creating separate issue for that. |
Is there a way to disable this "extension"? |
See #956 Closing as stale, please open a new issue with reference is you are still using marked and have the same request. Thank you. @UziTech: Here's one of those moments I'm curious about regarding the continued use of marked "in the wild". Marked looks unkempt according to the cross-project PR referenced above. Having said that, the PR is still open after a year. And that project is starting show signs of either be stale, completely stable, or unused. Given what I assume to be low usage numbers for Elm, in general, I would not be surprised. Anyway, just considering the possibilities of false positives for marked's prevalence in the wild on active projects. |
Here is what I don't understand: Why does marked parse some features in HTML blocks and not others?
Example 1
Outputs
Example 2
Output
I would like, most, to see these issues being fixed, allowing HTML blocks to be truly untouched. Then, begin further discussion on other topics like #66, #133, #115.
The text was updated successfully, but these errors were encountered: