Skip to content

Markdown writer eats figure attributes #10867

@lierdakil

Description

@lierdakil

Explain the problem.

Consider the following input (native):

[ Figure
    ( "fig:foo" , [] , [ ( "label" , "1.1" ) ] )
    (Caption
       Nothing
       [ Plain
           [ Str "Figure" , Space , Str "1.1:" , Space , Str "Figure" ]
       ])
    [ Plain
        [ Image
            ( "" , [] , [] )
            [ Str "Figure" , Space , Str "1.1:" , Space , Str "Figure" ]
            ( "./image.png" , "" )
        ]
    ]
]

The figure has an id and some attributes, while the image has neither. Running pandoc -f native -t markdown produces

![Figure 1.1: Figure](./image.png)

I would expect writing out an explicit figure. I could also accept merging figure attributes into image attributes and outputting an implicit figure.

Curiously, if the only figure attribute is id, then it works as expected. But if either class or kv attributes are present, all attributes disappear in the output.

Pandoc version?

v3.7, v3.7.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions