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

Account for Etree Elements in HTML Stash #1042

Merged
merged 1 commit into from
Oct 14, 2020
Merged

Conversation

waylan
Copy link
Member

@waylan waylan commented Oct 14, 2020

By calling str on all stash elements we ensure they don't raise an error.
Worse case, something like <Element 'div' at 0x000001B2DAE94900> gets
inserted into the output. However, with the override in the md_in_html
extension, we actually serialize and reinsert the original HTML. Worse case,
an HTML block which should be parsed as Markdown gets skipped by the
extension (<div markdown="block"></div> gets inserting into the output).

The tricky part is testing as there should be no known cases where this
ever occurs. Therefore, we forcefully pass an etree Element directly to
the method in the test. That said, as #1040 is unresolved at this point,
I have tested locally with a real existing case and it works well.

Related to #1040.

By calling str on all stash elements we ensure they don't raise an error.
Worse case, soemthing like `<Element 'div' at 0x000001B2DAE94900>` gets
inserted into the output. However, with the override in the md_in_html
extension, we actually serialize and reinsert the original HTML. Worse case,
an HTML block which should be parsed as Markdown gets skipped by the
extension (`<div markdown="block"></div>` gets inserting into the output).

The tricky part is testing as there should be no known cases where this
ever occurs. Therefore, we forefully pass an etree Element directly to
the method in the test. That said, as Python-Markdown#1040 is unresolved at this point,
I have tested locally with a real existing case and it works well.

Related to Python-Markdown#1040.
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

Successfully merging this pull request may close these issues.

1 participant