Skip to content

[fuzz result]: Incorrect match nesting when an unmatched delimiter is flanked by other delimiters #739

@notriddle

Description

@notriddle

Notice the very counterintuitive behavior where _x_\n*{*{ recognizes the last two asterisks as delimiters, but if the x is turned into an asterisk, they stop being recognized.

Events from pulldown-cmark:

"_*_\n*{*{\n" -> [
  Start(Paragraph)
    Start(Emphasis)
      Text(Borrowed("*"))
    End(Emphasis)
    SoftBreak
    Text(Boxed("*{*{"))
  End(Paragraph)
]

Events from pandoc:

"_*_\n*{*{\n" -> [
  Start(Paragraph)
    Start(Emphasis)
      Text(Boxed("*"))
    End(Emphasis)
    SoftBreak
    Start(Emphasis)
      Text(Boxed("{"))
    End(Emphasis)
    Text(Boxed("{"))
  End(Paragraph)
]

Events from commonmark.js:

"_*_\n*{*{\n" -> [
  Start(Paragraph)
    Start(Emphasis)
      Text(Boxed("*"))
    End(Emphasis)
    SoftBreak
    Start(Emphasis)
      Text(Boxed("{"))
    End(Emphasis)
    Text(Boxed("{"))
  End(Paragraph)
]

AST from pandoc:

Pandoc {
    meta: {},
    blocks: [
        Para(
            [
                Emph(
                    [
                        Str(
                            "*",
                        ),
                    ],
                ),
                SoftBreak,
                Emph(
                    [
                        Str(
                            "{",
                        ),
                    ],
                ),
                Str(
                    "{",
                ),
            ],
        ),
    ],
}

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