Python-Markdown / markdown

A Python implementation of John Gruber’s Markdown with Extension support.
https://python-markdown.github.io/
BSD 3-Clause "New" or "Revised" License
3.71k stars 856 forks source link

Refactor `abbr` Extension #1461

Closed waylan closed 4 months ago

waylan commented 4 months ago

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.

waylan commented 4 months ago

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.