Skip to content

Quotation Marks Not Parsed Correctly #619

@jonathan-gruber-jg

Description

@jonathan-gruber-jg

Quotation marks in a Markdown file are not always parsed correctly.

Suppose that the file test.md has the contents

"A B"

'A B'

and the file test.tex has the contents

\documentclass{article}

\usepackage{markdown}

\begin{document}
\markdownInput{test.md}
\end{document}

.

Observed behavior

The Markdown implementation Discount parses test.md as the HTML

<p>&ldquo;A B&rdquo;</p>

<p>&lsquo;A B&rsquo;</p>

while the Markdown implementation MD4C parses test.md as the HTML

<p>&quot;A B&quot;</p>

<p>&apos;A B&apos;</p>

. However, when we typeset test.tex, then test.md is effectively parsed as the HTML

<p>&rdquo;A B&rdquo;</p>

<p>&rsquo;A B&rsquo;</p>

or apparently as the LaTeX

\textquotedblright{}A B\textquotedblright{}

\textquoteright{}A B\textquoteright{}

.

Expected behavior

I would have expected for test.md to be parsed as one of the possibilities below:

  1. The HTML

    <p>&ldquo;A B&rdquo;</p>
    
    <p>&lsquo;A B&rsquo;</p>

    and LaTeX

    \textquotedblleft{}A B\textquotedblright{}
    
    \textquoteleft{}A B\textquoteright{}

    , or

  2. The HTML

    <p>&quot;A B&quot;</p>
    
    <p>&apos;A B&apos;</p>

    and the LaTeX

    \textquotedbl{}A B\textquotedbl
    
    \textquotesingle{}A B\textquotesingle

    .

System information

TeX distribution: TeX Live 2025.
TeX version: 3.141592653
LuaTeX version: 1.22.0
XeTeX version: 3.141592653-2.6-0.999997
"markdown" package version: 3.13.0-0-gdd212d58
Operating system: Arch Linux with kernel version 6.18.7-arch1-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions