sergiocorreia / panflute

An Pythonic alternative to John MacFarlane's pandocfilters, with extra helper functions
http://scorreia.com/software/panflute/
BSD 3-Clause "New" or "Revised" License
493 stars 60 forks source link

stringify bug with Cite #204

Closed ickc closed 2 years ago

ickc commented 2 years ago

versions:

pf.__version__
'2.1.3'
pandoc --version
pandoc 2.16.2

Example:

>>> convert_text("[@abc, p.23]", standalone=True).content
ListContainer(Para(Cite(Str([@abc,) Space Str(p.23]))))
>>> print(stringify(convert_text("[@abc, p.23]", standalone=True)))
[@abc, p.23], p.23

Should we be expecting [@abc, p.23] instead?

Note that in terms of native it is:

[ Para
    [ Cite
        [ Citation
            { citationId = "abc"
            , citationPrefix = []
            , citationSuffix = [ Str "," , Space , Str "p.23" ]
            , citationMode = NormalCitation
            , citationNoteNum = 1
            , citationHash = 0
            }
        ]
        [ Str "[@abc," , Space , Str "p.23]" ]
    ]
]