aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-10-30 23:15:28 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-10-30 23:15:28 +0000
commit3dbd266d21f94aebce5cd458f6d632bac79804ec (patch)
tree1f42e3ddca2c4d872fb697e642dc71356ca5d891 /src/Text/Pandoc
parent10633afb8d1eb066f97d6a09f8f5ff1fc4630a1e (diff)
downloadpandoc-3dbd266d21f94aebce5cd458f6d632bac79804ec.tar.gz
Improved LaTeX writer's handling of dashes:
+ Recognize a double hyphen as an Em-dash, even when it occurs next to punctuation (e.g. a quotation mark). + Collapse space around Em-dashes. + Process quotes before dashes. This way (foo -- 'bar') will turn into (foo---`bar') instead of (foo---'bar'). git-svn-id: https://pandoc.googlecode.com/svn/trunk@49 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs6
1 files changed, 3 insertions, 3 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