LaTeX writer: Avoid inadvertently creating ? or !
ligatures.
These are upside down ? and !, resp. Closes #5407.
This commit is contained in:
parent
5fa4ea8eb1
commit
93ee73e1dc
2 changed files with 22 additions and 0 deletions
|
@ -340,6 +340,14 @@ stringToLaTeX context zs = do
|
|||
-> cs <> xs
|
||||
_ -> cs <> "{}" <> xs
|
||||
in case x of
|
||||
'?' | ligatures -> -- avoid ?` ligature
|
||||
case xs of
|
||||
'`':_ -> emits "?{}"
|
||||
_ -> emitc x
|
||||
'!' | ligatures -> -- avoid !` ligature
|
||||
case xs of
|
||||
'`':_ -> emits "!{}"
|
||||
_ -> emitc x
|
||||
'{' -> emits "\\{"
|
||||
'}' -> emits "\\}"
|
||||
'`' | ctx == CodeString -> emitcseq "\\textasciigrave"
|
||||
|
|
14
test/command/5407.md
Normal file
14
test/command/5407.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
```
|
||||
% pandoc -t latex --wrap=preserve
|
||||
hi there?“
|
||||
hi there!“
|
||||
hi there?‘
|
||||
hi there!‘
|
||||
hi there!
|
||||
^D
|
||||
hi there?{}``
|
||||
hi there!{}``
|
||||
hi there?{}`
|
||||
hi there!{}`
|
||||
hi there!
|
||||
```
|
Loading…
Reference in a new issue