git.iko.soy/typeable/pandoc
on master help sign in
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

commit3dbd266d21f94aebce5cd458f6d632bac79804ec authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 30 Oct 2006, 23:15 (20 years ago) parent10633af
2 files changed+4−4
src/Text/Pandoc/Writers/LaTeX.hs+3−3 tests/writer.latex+1−1
src/Text/Pandoc/Writers/LaTeX.hs+3−3
@@ -78,10 +78,10 @@ escapeSingleQuotes =
7878escapeEllipses = gsub "\\.\\.\\.|\\. \\. \\." "\\ldots{}"
7979
8080escapeDashes = gsub "([0-9])-([0-9])" "\\1--\\2" .
81− gsub " -- " "---" .
82− gsub "([^[:punct:][:space:]])--([^[:punct:][:space:]])" "\\1---\\2"
81+ gsub " *--- *" "---" .
82+ gsub "([^-])--([^-])" "\\1---\\2"
8383
84−escapeSmart = escapeSingleQuotes . escapeDoubleQuotes . escapeDashes . escapeEllipses
84+escapeSmart = escapeDashes . escapeSingleQuotes . escapeDoubleQuotes . escapeEllipses
8585
8686-- | Escape string for LaTeX (including smart quotes, dashes, ellipses)
8787stringToLaTeX :: String -> String
tests/writer.latex+1−1
@@ -383,7 +383,7 @@ This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!, \verb!<html>!.
383383
384384Here is some quoted `\verb!code!' and a ``\href{http://example.com/?foo=1&bar=2}{quoted link}''.
385385
386−Some dashes: one---two --- three---four---five.
386+Some dashes: one---two---three---four---five.
387387
388388Dashes between numbers: 5--7, 255--66, 1987--1999.
389389