Markdown smart typography: Em dashes no longer eat surrounding whitespace.
Resolves Issue #69. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1279 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
efb9fd8d53
commit
cd38d4ae79
12 changed files with 12 additions and 13 deletions
|
@ -851,8 +851,7 @@ dash = enDash <|> emDash
|
|||
|
||||
enDash = try $ char '-' >> notFollowedBy (noneOf "0123456789") >> return EnDash
|
||||
|
||||
emDash = try $ skipSpaces >> oneOfStrings ["---", "--"] >>
|
||||
skipSpaces >> return EmDash
|
||||
emDash = oneOfStrings ["---", "--"] >> return EmDash
|
||||
|
||||
whitespace = do
|
||||
sps <- many1 (oneOf spaceChars)
|
||||
|
|
|
@ -275,7 +275,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
|
|||
, Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees",Str ".",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine",Str "."]]
|
||||
, Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go",Str "."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Apostrophe,Str "s?"]
|
||||
, Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
|
||||
, Para [Str "Some",Space,Str "dashes:",Space,Str "one",EmDash,Str "two",EmDash,Str "three",EmDash,Str "four",EmDash,Str "five",Str "."]
|
||||
, Para [Str "Some",Space,Str "dashes:",Space,Str "one",EmDash,Str "two",Space,EmDash,Space,Str "three",EmDash,Str "four",Space,EmDash,Space,Str "five",Str "."]
|
||||
, Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",EnDash,Str "7,",Space,Str "255",EnDash,Str "66,",Space,Str "1987",EnDash,Str "1999",Str "."]
|
||||
, Para [Str "Ellipses",Ellipses,Str "and",Ellipses,Str "and",Ellipses,Str "."]
|
||||
, HorizontalRule
|
||||
|
|
|
@ -616,7 +616,7 @@ is \quote{pine.}
|
|||
Here is some quoted \quote{\type{code}} and a
|
||||
\quotation{\useURL[3][http://example.com/?foo=1&bar=2][][quoted link]\from[3]}.
|
||||
|
||||
Some dashes: one---two---three---four---five.
|
||||
Some dashes: one---two --- three---four --- five.
|
||||
|
||||
Dashes between numbers: 5--7, 255--66, 1987--1999.
|
||||
|
||||
|
|
|
@ -829,7 +829,7 @@ These should not be escaped: \$ \\ \> \[ \{
|
|||
<quote><ulink url="http://example.com/?foo=1&bar=2">quoted link</ulink></quote>.
|
||||
</para>
|
||||
<para>
|
||||
Some dashes: one—two—three—four—five.
|
||||
Some dashes: one—two — three—four — five.
|
||||
</para>
|
||||
<para>
|
||||
Dashes between numbers: 5–7, 255–66, 1987–1999.
|
||||
|
|
|
@ -708,7 +708,7 @@ Blah
|
|||
>quoted link</a
|
||||
>”.</p
|
||||
><p
|
||||
>Some dashes: one—two—three—four—five.</p
|
||||
>Some dashes: one—two — three—four — five.</p
|
||||
><p
|
||||
>Dashes between numbers: 5–7, 255–66, 1987–1999.</p
|
||||
><p
|
||||
|
|
|
@ -551,7 +551,7 @@ c\ensuremath{\sim}d.
|
|||
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.
|
||||
|
||||
|
|
|
@ -537,7 +537,7 @@ unescaped spaces: a^b c^d, a~b c~d\.
|
|||
Here is some quoted `\f[B]code\f[]' and a
|
||||
\[lq]quoted link (http://example.com/?foo=1&bar=2)\[rq]\.
|
||||
.PP
|
||||
Some dashes: one\[em]two\[em]three\[em]four\[em]five\.
|
||||
Some dashes: one\[em]two \[em] three\[em]four \[em] five\.
|
||||
.PP
|
||||
Dashes between numbers: 5\[en]7, 255\[en]66, 1987\[en]1999\.
|
||||
.PP
|
||||
|
|
|
@ -480,7 +480,7 @@ unescaped spaces: a\^b c\^d, a\~b c\~d.
|
|||
Here is some quoted '`code`' and a
|
||||
"[quoted link](http://example.com/?foo=1&bar=2)".
|
||||
|
||||
Some dashes: one--two--three--four--five.
|
||||
Some dashes: one--two -- three--four -- five.
|
||||
|
||||
Dashes between numbers: 5-7, 255-66, 1987-1999.
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
|
|||
, Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees",Str ".",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine",Str "."]]
|
||||
, Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go",Str "."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Apostrophe,Str "s?"]
|
||||
, Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."]
|
||||
, Para [Str "Some",Space,Str "dashes:",Space,Str "one",EmDash,Str "two",EmDash,Str "three",EmDash,Str "four",EmDash,Str "five",Str "."]
|
||||
, Para [Str "Some",Space,Str "dashes:",Space,Str "one",EmDash,Str "two",Space,EmDash,Space,Str "three",EmDash,Str "four",Space,EmDash,Space,Str "five",Str "."]
|
||||
, Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",EnDash,Str "7,",Space,Str "255",EnDash,Str "66,",Space,Str "1987",EnDash,Str "1999",Str "."]
|
||||
, Para [Str "Ellipses",Ellipses,Str "and",Ellipses,Str "and",Ellipses,Str "."]
|
||||
, HorizontalRule
|
||||
|
|
|
@ -609,7 +609,7 @@ Smart quotes, ellipses, dashes
|
|||
Here is some quoted '``code``' and a
|
||||
"`quoted link <http://example.com/?foo=1&bar=2>`_".
|
||||
|
||||
Some dashes: one--two--three--four--five.
|
||||
Some dashes: one--two -- three--four -- five.
|
||||
|
||||
Dashes between numbers: 5-7, 255-66, 1987-1999.
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ emphasized link
|
|||
quoted link
|
||||
}}}
|
||||
\u8221".\par}
|
||||
{\pard \ql \f0 \sa180 \li0 \fi0 Some dashes: one\u8212-two\u8212-three\u8212-four\u8212-five.\par}
|
||||
{\pard \ql \f0 \sa180 \li0 \fi0 Some dashes: one\u8212-two \u8212- three\u8212-four \u8212- five.\par}
|
||||
{\pard \ql \f0 \sa180 \li0 \fi0 Dashes between numbers: 5\u8211-7, 255\u8211-66, 1987\u8211-1999.\par}
|
||||
{\pard \ql \f0 \sa180 \li0 \fi0 Ellipses\u8230?and\u8230?and\u8230?.\par}
|
||||
{\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par}
|
||||
|
|
|
@ -688,7 +688,7 @@ These should not be superscripts or subscripts@comma{} because of the unescaped
|
|||
|
||||
Here is some quoted `@code{code}' and a ``@uref{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@comma{} 255--66@comma{} 1987--1999.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue