git.iko.soy/typeable/pandoc
on master help sign in
Texinfo writer: fix wrapping by using breakable spaces
commit858ebf99ebe809685ca42fced374ceeaea3a832c authorTim Lin <timtylin@gmail.com> dateFri 6 Feb 2015, 01:16 (12 years ago) parentfb7a03d
2 files changed+32−13
src/Text/Pandoc/Writers/Texinfo.hs+1−1 tests/writer.texinfo+31−12
src/Text/Pandoc/Writers/Texinfo.hs+1−1
@@ -422,7 +422,7 @@ inlineToTexinfo (RawInline f str)
422422 | f == "texinfo" = return $ text str
423423 | otherwise = return empty
424424inlineToTexinfo (LineBreak) = return $ text "@*"
425−inlineToTexinfo Space = return $ char ' '
425+inlineToTexinfo Space = return $ space
426426
427427inlineToTexinfo (Link txt (src@('#':_), _)) = do
428428 contents <- escapeCommas $ inlineListToTexinfo txt
tests/writer.texinfo+31−12
@@ -36,7 +36,8 @@ July 17, 2006
3636@node Top
3737@top Pandoc Test Suite
3838
39−This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.
39+This is a set of tests for pandoc. Most of them are adapted from John Gruber's
40+markdown test suite.
4041
4142@iftex
4243@bigskip@hrule@bigskip
@@ -125,7 +126,9 @@ with no blank line
125126@anchor{#paragraphs}
126127Here's a regular paragraph.
127128
128−In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.
129+In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
130+Because a hard-wrapped line in the middle of a paragraph looked like a list
131+item.
129132
130133Here's one with a bullet. * criminey.
131134
@@ -734,11 +737,14 @@ This is code: @code{>}, @code{$}, @code{\}, @code{\$}, @code{<html>}.
734737
735738@textstrikeout{This is @emph{strikeout}.}
736739
737−Superscripts: a@textsuperscript{bc}d a@textsuperscript{@emph{hello}} a@textsuperscript{hello@ there}.
740+Superscripts: a@textsuperscript{bc}d a@textsuperscript{@emph{hello}}
741+a@textsuperscript{hello@ there}.
738742
739−Subscripts: H@textsubscript{2}O, H@textsubscript{23}O, H@textsubscript{many@ of@ them}O.
743+Subscripts: H@textsubscript{2}O, H@textsubscript{23}O,
744+H@textsubscript{many@ of@ them}O.
740745
741−These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
746+These should not be superscripts or subscripts, because of the unescaped
747+spaces: a^b c^d, a~b c~d.
742748
743749@iftex
744750@bigskip@hrule@bigskip
@@ -758,7 +764,8 @@ These should not be superscripts or subscripts, because of the unescaped spaces:
758764
759765`He said, ``I want to go.''' Were you alive in the 70's?
760766
761−Here is some quoted `@code{code}' and a ``@uref{http://example.com/?foo=1&bar=2,quoted link}''.
767+Here is some quoted `@code{code}' and a
768+``@uref{http://example.com/?foo=1&bar=2,quoted link}''.
762769
763770Some dashes: one---two --- three---four --- five.
764771
@@ -792,7 +799,8 @@ Ellipses@dots{}and@dots{}and@dots{}.
792799@item
793800@math{p}-Tree
794801@item
795−Here's some display math: @math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}
802+Here's some display math:
803+@math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}
796804@item
797805Here's one that has a line break in it: @math{\alpha + \omega \times x^2}.
798806@end itemize
@@ -803,7 +811,8 @@ These shouldn't be math:
803811@item
804812To get the famous equation, write @code{$e = mc^2$}.
805813@item
806−$22,000 is a @emph{lot} of money. So is $34,000. (It worked if ``lot'' is emphasized.)
814+$22,000 is a @emph{lot} of money. So is $34,000. (It worked if ``lot'' is
815+emphasized.)
807816@item
808817Shoes ($20) and socks ($5).
809818@item
@@ -956,7 +965,8 @@ Foo @uref{/url/,biz}.
956965@node With ampersands
957966@section With ampersands
958967@anchor{#with-ampersands}
959−Here's a @uref{http://example.com/?foo=1&bar=2,link with an ampersand in the URL}.
968+Here's a @uref{http://example.com/?foo=1&bar=2,link with an ampersand in the
969+URL}.
960970
961971Here's a link with an amersand in the link text: @uref{http://att.com/,AT&T}.
962972
@@ -1018,15 +1028,24 @@ Here is a movie @image{movie,,,movie,jpg} icon.
10181028@node Footnotes
10191029@chapter Footnotes
10201030@anchor{#footnotes}
1021−Here is a footnote reference,@footnote{Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.} and another.@footnote{Here's the long note. This one contains multiple blocks.
1031+Here is a footnote reference,@footnote{Here is the footnote. It can go
1032+anywhere after the footnote reference. It need not be placed at the end of the
1033+document.} and another.@footnote{Here's the long note. This one contains
1034+multiple blocks.
10221035
1023−Subsequent blocks are indented to show that they belong to the footnote (as with list items).
1036+Subsequent blocks are indented to show that they belong to the footnote (as
1037+with list items).
10241038
10251039@verbatim
10261040 { <code> }
10271041@end verbatim
10281042
1029−If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.} This should @emph{not} be a footnote reference, because it contains a space.[^my note] Here is an inline note.@footnote{This is @emph{easier} to type. Inline notes may contain @uref{http://google.com,links} and @code{]} verbatim characters, as well as [bracketed text].}
1043+If you want, you can indent every line, but you can also be lazy and just
1044+indent the first line of each block.} This should @emph{not} be a footnote
1045+reference, because it contains a space.[^my note] Here is an inline
1046+note.@footnote{This is @emph{easier} to type. Inline notes may contain
1047+@uref{http://google.com,links} and @code{]} verbatim characters, as well as
1048+[bracketed text].}
10301049
10311050@quotation
10321051Notes can go in quotes.@footnote{In quote.}