aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-12 13:40:28 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-12 13:40:28 -0700
commit0ab8670a0eb52b5da2bef64b2cc1917e4d5ddb54 (patch)
tree42eef621e120ec47c035a3e75b289b1a17d879f2
parent3897df868ad1e0ca5409e8fffd86c73dbf6f2b31 (diff)
downloadpandoc-0ab8670a0eb52b5da2bef64b2cc1917e4d5ddb54.tar.gz
LaTeX reader: Fixed space after \figurename etc.
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs5
-rw-r--r--test/command/translations.md24
2 files changed, 17 insertions, 12 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 754f379f9..284dce2bc 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -1351,10 +1351,7 @@ inlineCommands = M.fromList $
]
doTerm :: PandocMonad m => Translations.Term -> LP m Inlines
-doTerm term = do
- s <- (symbol '~' >> return (str "\160")) <|> return space
- t <- translateTerm term
- return (str t <> s)
+doTerm term = str <$> translateTerm term
ifstrequal :: PandocMonad m => LP m Inlines
ifstrequal = do
diff --git a/test/command/translations.md b/test/command/translations.md
index ef5b28c78..34531df7c 100644
--- a/test/command/translations.md
+++ b/test/command/translations.md
@@ -1,21 +1,29 @@
```
-% pandoc -f latex -t plain -M lang=en
-\figurename 2
+% pandoc -f latex -t native -M lang=en
+\figurename\ 2
^D
-Figure 2
+[Para [Str "Figure\160\&2"]]
```
```
-% pandoc -f latex -t plain -M lang=de-DE
-\figurename 2
+% pandoc -f latex -t native -M lang=de-DE
+\figurename\ 2
^D
-Abbildung 2
+[Para [Str "Abbildung\160\&2"]]
```
```
-% pandoc -f latex -t plain -M lang=en
+% pandoc -f latex -t native -M lang=en
\setmainlanguage{german}
\figurename 2
^D
-Abbildung 2
+[Para [Str "Abbildung2"]]
+```
+
+```
+% pandoc -f latex -t native -M lang=sr
+\figurename~2
+\figurename.
+^D
+[Para [Str "Slika\160\&2",SoftBreak,Str "Slika."]]
```