diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-05-18 22:55:47 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-05-18 22:55:47 +0200 |
commit | eb3dff148e67e84362632e63848d40ba808940f4 (patch) | |
tree | 594df8c0bb9ed01112f0f28606df38ddbd5060db | |
parent | fa23effe2567183ec424feda55f507e27f50f7c8 (diff) | |
download | pandoc-eb3dff148e67e84362632e63848d40ba808940f4.tar.gz |
LaTeX writer: separate successive quote chars with thin space
Successive quote characters are separated with a thin space to improve
readability and to prevent unwanted ligatures. Detection of these quotes
sometimes had failed if the second quote was nested in a span element.
Closes: #6958
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 5 | ||||
-rw-r--r-- | test/command/6958.md | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index bf57937bd..978f94ea0 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -894,8 +894,9 @@ inlineToLaTeX (Quoted qt lst) = do then char '`' <> inner <> char '\'' else char '\x2018' <> inner <> char '\x2019' where - isQuoted (Quoted _ _) = True - isQuoted _ = False + isQuoted (Span _ (x:_)) = isQuoted x + isQuoted (Quoted _ _) = True + isQuoted _ = False inlineToLaTeX (Str str) = do setEmptyLine False liftM literal $ stringToLaTeX TextString str diff --git a/test/command/6958.md b/test/command/6958.md new file mode 100644 index 000000000..230371d7d --- /dev/null +++ b/test/command/6958.md @@ -0,0 +1,10 @@ +Add thin space between single and double quotes. +``` +% pandoc -t latex+smart +--- +lang: en-GB +--- +'["On the Outside"]{}: Constructing Cycling Citizenship.' +^D +`\,{``On the Outside''}: Constructing Cycling Citizenship.' +``` |