Skip to content

Provide Tag and Event source locations. #725

@Caellian

Description

@Caellian

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions