swiftlang / swift-markdown

A Swift package for parsing, building, editing, and analyzing Markdown documents.
https://swiftpackageindex.com/swiftlang/swift-markdown/documentation/markdown
Apache License 2.0
2.79k stars 191 forks source link

Callbacks from MarkupFormatter #162

Open amyworrall opened 10 months ago

amyworrall commented 10 months ago

I am using MarkupFormatter. I need to know the precise string range for certain bits of markup in the outputted string.

I'm suggesting an API for MarkupFormatter that does a callback whenever it is processing a node, giving access to State. (Preferably a willProcess then a didProcess). That way I could store the relevant bits of state that I needed.