Skip to content

Tracking backslash escapes? #450

Description

@zkamvar

I think this is similar/related to #131 and #292, but one thing I noticed is that bare square brackets do not roundtrip:

Input:

[unescaped brackets],  \[escaped brackets\] and [a link](https://example.com)

Output:

\[unescaped brackets\],  \[escaped brackets\] and [a link](https://example.com)

Is there a way to add an attribute that can track the position of escaped characters in a line?

This is useful for me because I'm trying to parse and rewrite documents that have reference links in child documents, and I have to backtrack to identify and protect these links from being overwritten.

(originally reported this in r-lib/commonmark#20)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions