Hey, @colinodell: I've used a partial in my Markdown for the last year.
I inject the HTML as a preprocessing step before handing it over to #PHP League #CommonMark.
A pattern contains a key. Check the user dict of class names. If the key exists, invoke the class.
I'm debating building a CommonMark extension, not part of the core.
I don't think the extension would cause a #CyberSecurity issue since it's a facilitator, not a processor. Curious about your thoughts and a second pair of eyes.
I'm sure some of this is due to the "new shoes" problem, but I think incorporating the partials logic directly into #CommonMark is actually a performance improvement: https://joshbruce.com/essays-and-editorials/action-loop/
I didn't run a profile before the change, but I did run the same set I used in 2022, and it at least didn't slow down: https://joshbruce.com/experiences/software-development/this-site/2022/
Good times and I added partials to the fluent common mark library:
https://packagist.org/packages/8fold/commonmark-partials
https://packagist.org/packages/8fold/commonmark-fluent-markdown
Cheers