Skip to content

Add markdown.treeprocessors.UnescapeTreeprocessor #9671

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

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

andersk
Copy link
Contributor

@andersk andersk commented Feb 4, 2023

This replaced the deprecated markdown.postprocessors.UnescapePostprocessor in Python-Markdown/markdown#1272.

@github-actions

This comment has been minimized.

@andersk andersk force-pushed the markdown-unescape-treeprocessor branch 2 times, most recently from 9e0df55 to fe0facb Compare February 4, 2023 01:01
@github-actions

This comment has been minimized.


from . import util

def build_treeprocessors(md, **kwargs): ...
def isString(s): ...

class Treeprocessor(util.Processor):
def run(self, root) -> Any | None: ...
def run(self, root: Element) -> Element | None: ...
Copy link
Member

@AlexWaygood AlexWaygood Feb 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring refers to this method as taking an ElementTree object, and xml.etree.ElementTree.ElementTree is a different class to xml.etree.ElementTree.Element. Is the docstring incorrect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, but yes, it’s really an Element, not an ElementTree: note this .getroot() call.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I hate typing XML 🙃

This replaced the deprecated
`markdown.postprocessors.UnescapePostprocessor` in
Python-Markdown/markdown#1272.

Signed-off-by: Anders Kaseorg <[email protected]>
@andersk andersk force-pushed the markdown-unescape-treeprocessor branch from e1700aa to 36d63ae Compare February 9, 2023 08:18
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit 8e0b56f into python:main Feb 9, 2023
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.

2 participants