-
Notifications
You must be signed in to change notification settings - Fork 269
Description
I want to suggest that Events and Tags retain their source location and for it to be accessible when they are consumed.
Currently, if the CommonMark parses something as an element, there's no way of restoring it back to source form (without possibly losing spacing/symbols).
This would allow multi-line Events to capture raw contents which would make it straightforward to fix issues like #716.
It also addresses extensibility as non-standard parsers could detect markers/delimiters in Event::Text and reinterpret all intermediate events/tags as raw text for processing. That means that extensions could be implemented as structs implementing Iterator<Item = MyEvent> and wrapping pulldown-cmark::Parser which would make them very composable.
Also, bare CommonMark parser could be separated and extended as needed by end-users, while an extension layer that takes in current Options could provide currently supported non-standard functionality.