pandoc/test/command/ascii.md
John MacFarlane 633a9ecfec LaTeX writer: avoid {} after control sequences when escaping.
`\ldots{}.` doesn't behave as well as `\ldots.` with the latex
ellipsis package.  This patch causes pandoc to avoid emitting
the `{}` when it is not necessary.  Now `\ldots` and other
control sequences used in escaping will be followed by either
a `{}`, a space, or nothing, depending on context.

Thanks to Elliott Slaughter for the suggestion.
2019-02-01 21:17:46 -08:00

1.1 KiB

pandoc -t html --ascii
äéıå
^D
<p>&auml;&eacute;&imath;&aring;</p>
pandoc -t latex --ascii
äéıå
^D
\"{a}\'{e}\i\r{a}
pandoc -t man --ascii
äéıå
^D
.PP
\[:a]\['e]\[.i]\[oa]
pandoc -t ms --ascii
äéıå
^D
.LP
\[:a]\['e]\[.i]\[oa]
pandoc -t docbook --ascii
äéıå
^D
<para>
  &#228;&#233;&#305;&#229;
</para>
pandoc -t jats --ascii
äéıå
^D
<p>&#228;&#233;&#305;&#229;</p>
pandoc -t markdown-smart --ascii
"äéıå"
^D
&ldquo;&auml;&eacute;&imath;&aring;&rdquo;

CommonMark tests

% pandoc -f commonmark -t commonmark --ascii
hello … ok? … bye
^D
hello &mldr; ok? &mldr; bye
% pandoc -f commonmark+smart -t commonmark-smart --ascii --wrap=none
"hi"...dog's breath---cat 5--6
^D
&ldquo;hi&rdquo;&mldr;dog&rsquo;s breath&mdash;cat 5&ndash;6
% pandoc -f commonmark+smart -t commonmark+smart --ascii
"hi"...dog's breath---cat 5--6
^D
"hi"...dog's breath---cat 5--6
% pandoc -f commonmark -t commonmark --ascii
foo &#1234; bar
^D
foo &#1234; bar
% pandoc -f commonmark -t commonmark --ascii
\[foo\](bar)
^D
\[foo\](bar)