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

Refactor abbr Extension #1461

Merged
merged 5 commits into from
Apr 25, 2024
Merged

Refactor abbr Extension #1461

merged 5 commits into from
Apr 25, 2024

Conversation

waylan
Copy link
Member

@waylan waylan commented Apr 24, 2024

A new AbbrTreeprocessor has been introduced, which replaces the now deprecated AbbrInlineProcessor. Abbreviation processing now happens after Attribute Lists, avoiding a conflict between the two extensions. Fixes #1460.

As an aside, with this change we now have a collection of abbrs. It should probably be emptied on reset(). Also, it is now feasible to add a config option for predefined abbrs -- a feature request we have received multiple times in the past.

A new `AbbrTreeprocessor` has been introduced, which replaces the now
deprecated `AbbrInlineProcessor`. Abbreviation processing now happens
after Attribute Lists, avoiding a conflict between the two extensions.
Fixes Python-Markdown#1460.
@waylan
Copy link
Member Author

waylan commented Apr 24, 2024

I have added support for reset but not a config option to predefine abbreviations. I'm not sure I want to add that and a quick search didn't turn up any requests. Maybe I was thinking of something else.

docs/changelog.md Outdated Show resolved Hide resolved
markdown/extensions/abbr.py Outdated Show resolved Hide resolved
markdown/extensions/abbr.py Outdated Show resolved Hide resolved
@waylan waylan merged commit ec8c305 into Python-Markdown:master Apr 25, 2024
15 checks passed
@waylan waylan deleted the 1460 branch April 25, 2024 13:46
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.

abbr extension breaks title attribute added using attr_list
2 participants