Skip to content

Reader: Inline Spans inside superscript is no more possible since 3.8.1 as it is parsed first as inline notes #11409

@cderv

Description

@cderv

I just discovered this change in 3.8.1

which is a breaking change if you want to use Inline Spans in a Superscript.

For example text^[sup]{.class}^

Pandoc 3.8

[ Para
    [ Str "text"
    , Superscript
        [ Span ( "" , [ "class" ] , [] ) [ Str "sup" ] ]
    ]
]

Pandoc 3.8.1

[ Para
    [ Str "text"
    , Note [ Para [ Str "sup" ] ]
    , Str "{.class}^"
    ]
]

Is this really expected ? How can you write Spans in superscript syntax now ?

This breaks the roundtrip as the Markdown writer will still write the same syntax text^[sup]{.class} which can't be read.

With Pandoc 3.8.3

❯ pandoc -f native -t markdown
[ Para
    [ Str "text"
    , Superscript
        [ Span ( "" , [ "class" ] , [] ) [ Str "sup" ] ]
    ]
]
^Z
text^[sup]{.class}^

So anyone using superscript syntax ^ follow by [ for inline spans will have footnotes now.

I see in commit that

We do not allow inline notes to be followed by ( or [.

Which allows

$ pandoc -t native -f markdown
^[link](/foo)^
^Z
[ Para
    [ Superscript
        [ Link ( "" , [] , [] ) [ Str "link" ] ( "/foo" , "" ) ]
    ]
]

Should `{` be added to `(` and `[` for Spans support ? 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions