Skip to content

Markdown reader: fix quotes in inline notes#11614

Merged
jgm merged 1 commit into
jgm:mainfrom
adunning:notes-quotes
May 4, 2026
Merged

Markdown reader: fix quotes in inline notes#11614
jgm merged 1 commit into
jgm:mainfrom
adunning:notes-quotes

Conversation

@adunning
Copy link
Copy Markdown
Contributor

@adunning adunning commented May 3, 2026

When parsing an inline note (^[...]) inside a quoted span, stateQuoteContext was still set to InSingleQuote/InDoubleQuote, meaning that quotes within notes failed to parse as Quoted nodes. Fix by wrapping the note body parser in withQuoteContext NoQuote.

Closes #11613.

Copilot AI review requested due to automatic review settings May 3, 2026 20:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Markdown reader edge case where inline note contents (^[...]) incorrectly inherited the surrounding quote context, preventing smart quotes inside the note from being parsed as Quoted nodes. It is a targeted parser fix in the Markdown reader with matching regression tests in the reader test suite.

Changes:

  • Reset quote context to NoQuote while parsing inline note bodies in the Markdown reader.
  • Add regression tests for single-quoted and double-quoted inline notes nested inside matching outer quoted spans.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Text/Pandoc/Readers/Markdown.hs Wraps inline note body parsing with withQuoteContext NoQuote so note contents are parsed independently of surrounding quote state.
test/Tests/Readers/Markdown.hs Adds smart-punctuation regression tests covering inline notes inside single and double quoted spans.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When parsing an inline note (`^[...]`) inside a quoted span,
`stateQuoteContext` was still set to `InSingleQuote`/`InDoubleQuote`,
so quotes within notes failed to parse as `Quoted` nodes.
Fix this by wrapping the note body parser in
`withQuoteContext NoQuote`.

Closes jgm#11613.
@jgm jgm merged commit 8e6aecf into jgm:main May 4, 2026
7 of 10 checks passed
@adunning adunning deleted the notes-quotes branch May 4, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quotations in footnotes within a quotation not detected as Quoted

3 participants