-
Notifications
You must be signed in to change notification settings - Fork 871
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
Adjust md_in_html
"markdown" blocks to process content consistently
#1503
Adjust md_in_html
"markdown" blocks to process content consistently
#1503
Conversation
Ensure `md_in_html` processes content inside a "markdown" block the same way content is processed outside of a "markdown" block. - Flatten the HTML content into placeholders so that the parser will treat the "markdown" block content in the same way it does when `md_in_html` is not enabled. The placeholders are expanded once the parser reaches them in a linear fashion. This allows extensions to deal with HTML content and consume it the same way it deals with them with them when the content is not nested under a "markdown" block. - Instead of content being processed in dummy tags, content is now processed under the real parent allowing extensions to have better context to make better decisions.
I'll update changelog once I know if this change would like to be considered as a a bug or a feature. More importantly, I need to make sure this change is generally desired. |
Use format strings and check for None text
I think this is ready for review now. |
I decided to just add the change as a "fix" for now in the changelog. It fixes surprising behaviors and doesn't change any existing, tested functionality. If we wish to reclassify it, I can on request. |
I'm actually going to leave this in draft a little longer to test some more corner cases. |
I think I'll be able to fix #1075 while I'm in here, or at the very least improve results. I'm going to add more tests as I validate cases that are not covered in tests. |
Fix CDATA pattern
I've also fixed some issues with #1074. Working in the HTML parser isn't my idea of fun, so I just wanted to resolve the issues while I'm deep in the code as I'm unlikely to jump into it for a while. Again, existing tests are still passing and in addition, new tests check for the new inline block tag behavior. These changes really make I think I'm almost done validating edge cases and such. |
@waylan I think I've done all I can do on this. Whenever you get a chance, please take a look, give it a try, and let me know what you think. If there are some cases you think I'm missing, or you see some things you don't like, let me know. |
I do not have the bandwidth to review this at this time and don't know when I will. @facelessuser I trust you to proceed as you see fit. |
@waylan Thanks for letting me know. It seems you are generally not against the idea of what I've proposed, so with that in mind, I will spend some time going over it once again with a critical eye and merge if nothing is found. I'm more than happy to support any surprises post-release. |
@waylan I'll need either a review approval or permissions to override review when merging if I am to proceed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually reviewed this, but am approving so that @facelessuser can move forward as he sees fit.
Ensure
md_in_html
processes content inside a "markdown" block the same way content is processed outside of a "markdown" block.Flatten the HTML content into placeholders so that the parser will treat the "markdown" block content in the same way it does when
md_in_html
is not enabled. The placeholders are expanded once the parser reaches them in a linear fashion. This allows extensions to deal with HTML content and consume it the same way it deals with them with them when the content is not nested under a "markdown" block.Instead of content being processed in dummy tags, content is now processed under the real parent allowing extensions to have better context to make better decisions.
Additionally, fix some issues with tags and inline code.
Also, fix some issues with one-liner block tags, e.g.
<tag><tag>...
Resolves #1502
Resolves #1075
Resolves #1074