diff options
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 6 | ||||
-rw-r--r-- | tests/writer.latex | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index b77789e90..0674652cf 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -78,10 +78,10 @@ escapeSingleQuotes = escapeEllipses = gsub "\\.\\.\\.|\\. \\. \\." "\\ldots{}" escapeDashes = gsub "([0-9])-([0-9])" "\\1--\\2" . - gsub " -- " "---" . - gsub "([^[:punct:][:space:]])--([^[:punct:][:space:]])" "\\1---\\2" + gsub " *--- *" "---" . + gsub "([^-])--([^-])" "\\1---\\2" -escapeSmart = escapeSingleQuotes . escapeDoubleQuotes . escapeDashes . escapeEllipses +escapeSmart = escapeDashes . escapeSingleQuotes . escapeDoubleQuotes . escapeEllipses -- | Escape string for LaTeX (including smart quotes, dashes, ellipses) stringToLaTeX :: String -> String diff --git a/tests/writer.latex b/tests/writer.latex index 6f3efc710..7f632cb6d 100644 --- a/tests/writer.latex +++ b/tests/writer.latex @@ -383,7 +383,7 @@ This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!, \verb!<html>!. Here is some quoted `\verb!code!' and a ``\href{http://example.com/?foo=1&bar=2}{quoted link}''. -Some dashes: one---two --- three---four---five. +Some dashes: one---two---three---four---five. Dashes between numbers: 5--7, 255--66, 1987--1999. |