ITADN
jgm/pandoc/Issues

Quotations in footnotes within a quotation not detected as Quoted

#11613Closedadunning 创建于 2026-05-03
bug
A
adunningcommented
If a footnote containing a quotation is placed within a portion of text that is also a quotation, a closing rather than an opening quote is used for the quotation within the footnote. This only occurs if the same type of quotation marks is used both in the text and in the footnote. ## Minimum example ```shell pandoc -t plain << EOT 'This is a test^[Test, 'single quotes within single quotes'.] of quotation marks.' "This is a test^[Test, 'single quotes within double quotes'.] of quotation marks." 'This is a test^[Test, "double quotes within single quotes".] of quotation marks.' "This is a test^[Test, "double quotes within double quotes".] of quotation marks." EOT ``` ## Expected output Quotations in footnotes are handled separately from their surrounding text: ``` ‘This is a test[1] of quotation marks.’ “This is a test[2] of quotation marks.” ‘This is a test[3] of quotation marks.’ “This is a test[4] of quotation marks.” [1] Test, ‘single quotes within single quotes’. [2] Test, ‘single quotes within double quotes’. [3] Test, ”double quotes within single quotes”. [4] Test, ”double quotes within double quotes”. ``` ## Actual output Quotations within footnotes using the same type of quotation marks as the surrounding text, i.e. first and last examples below, use an closing/right quotation mark rather than the expected opening/left mark: ``` ‘This is a test[1] of quotation marks.’ “This is a test[2] of quotation marks.” ‘This is a test[3] of quotation marks.’ “This is a test[4] of quotation marks.” [1] Test, ’single quotes within single quotes’. [2] Test, ‘single quotes within double quotes’. [3] Test, “double quotes within single quotes”. [4] Test, ”double quotes within double quotes”. ``` In the AST, these examples are not shown as `Quoted`: ``` [ Quoted SingleQuote [ Str "This" , Space , Str "is" , Space , Str "a" , Space , Str "test" , Note [ Para [ Str "Test," , Space , Str "\8217single" , Space , Str "quotes" , Space , Str "within" , Space , Str "single" , Space , Str "quotes\8217." ] ] , Space , Str "of" , Space , Str "quotation" , Space , Str "marks." ] ] ``` ## Pandoc version pandoc 3.9.0.2 macOS 26.4.1
关闭于 2026-05-04 0 条评论