Skip to content

expose Sourcepos info to SyntaxHighlighterAdapters #298

@Gankra

Description

@Gankra

I'm working on a project that wants to provide a warning when the user uses an unknown language on a codefence, and we use miette's fancy machinery for printing out spans in the original source. It would be great if we could actually print out the line/col where we found the problem. It seems like comrak has that info in its AST, but the SyntaxHighlighterAdapter api doesn't expose it. comrak also buffers up intermediate results so we can't pull any "substring of the original input, do pointer comparisons" shenanigans.

There's a few different ways to introduce this kind of functionality (break the old trait methods, add new trait methods that default call the old ones, ...). Is there one you'd prefer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions