git.iko.soy/typeable/pandoc
on master help sign in
Texinfo writer: fix wrapping by using breakable spaces
858ebf9Tim Lin
src/Text/Pandoc/Writers/Texinfo.hs+1−1
@@ -422,7 +422,7 @@ inlineToTexinfo (RawInline f str)
422 | f == "texinfo" = return $ text str
422 | f == "texinfo" = return $ text str
423 | otherwise = return empty
423 | otherwise = return empty
424inlineToTexinfo (LineBreak) = return $ text "@*"
424inlineToTexinfo (LineBreak) = return $ text "@*"
425−inlineToTexinfo Space = return $ char ' '
425+inlineToTexinfo Space = return $ space
426
426
427inlineToTexinfo (Link txt (src@('#':_), _)) = do
427inlineToTexinfo (Link txt (src@('#':_), _)) = do
428 contents <- escapeCommas $ inlineListToTexinfo txt
428 contents <- escapeCommas $ inlineListToTexinfo txt
tests/writer.texinfo+31−12
@@ -36,7 +36,8 @@ July 17, 2006
36@node Top
36@node Top
37@top Pandoc Test Suite
37@top Pandoc Test Suite
38
38
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.
40
41
41@iftex
42@iftex
42@bigskip@hrule@bigskip
43@bigskip@hrule@bigskip
@@ -125,7 +126,9 @@ with no blank line
125@anchor{#paragraphs}
126@anchor{#paragraphs}
126Here's a regular paragraph.
127Here's a regular paragraph.
127
128
129+In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
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.
130+Because a hard-wrapped line in the middle of a paragraph looked like a list
131+item.
129
132
130Here's one with a bullet. * criminey.
133Here's one with a bullet. * criminey.
131
134
@@ -734,11 +737,14 @@ This is code: @code{>}, @code{$}, @code{\}, @code{\$}, @code{<html>}.
734
737
735@textstrikeout{This is @emph{strikeout}.}
738@textstrikeout{This is @emph{strikeout}.}
736
739
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}.
738
742
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.
740
745
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.
742
748
743@iftex
749@iftex
744@bigskip@hrule@bigskip
750@bigskip@hrule@bigskip
@@ -758,7 +764,8 @@ These should not be superscripts or subscripts, because of the unescaped spaces:
758
764
759`He said, ``I want to go.''' Were you alive in the 70's?
765`He said, ``I want to go.''' Were you alive in the 70's?
760
766
767+Here is some quoted `@code{code}' and a
761−Here is some quoted `@code{code}' and a ``@uref{http://example.com/?foo=1&bar=2,quoted link}''.
768+``@uref{http://example.com/?foo=1&bar=2,quoted link}''.
762
769
763Some dashes: one---two --- three---four --- five.
770Some dashes: one---two --- three---four --- five.
764
771
@@ -792,7 +799,8 @@ Ellipses@dots{}and@dots{}and@dots{}.
792@item
799@item
793@math{p}-Tree
800@math{p}-Tree
794@item
801@item
802+Here's some display math:
795−Here's some display math: @math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}
803+@math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}
796@item
804@item
797Here's one that has a line break in it: @math{\alpha + \omega \times x^2}.
805Here's one that has a line break in it: @math{\alpha + \omega \times x^2}.
798@end itemize
806@end itemize
@@ -803,7 +811,8 @@ These shouldn't be math:
803@item
811@item
804To get the famous equation, write @code{$e = mc^2$}.
812To get the famous equation, write @code{$e = mc^2$}.
805@item
813@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.)
807@item
816@item
808Shoes ($20) and socks ($5).
817Shoes ($20) and socks ($5).
809@item
818@item
@@ -956,7 +965,8 @@ Foo @uref{/url/,biz}.
956@node With ampersands
965@node With ampersands
957@section With ampersands
966@section With ampersands
958@anchor{#with-ampersands}
967@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}.
960
970
961Here's a link with an amersand in the link text: @uref{http://att.com/,AT&T}.
971Here's a link with an amersand in the link text: @uref{http://att.com/,AT&T}.
962
972
@@ -1018,15 +1028,24 @@ Here is a movie @image{movie,,,movie,jpg} icon.
1018@node Footnotes
1028@node Footnotes
1019@chapter Footnotes
1029@chapter Footnotes
1020@anchor{#footnotes}
1030@anchor{#footnotes}
1031+Here is a footnote reference,@footnote{Here is the footnote. It can go
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.
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.
1022
1035
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).
1024
1038
1025@verbatim
1039@verbatim
1026 { <code> }
1040 { <code> }
1027@end verbatim
1041@end verbatim
1028
1042
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].}
1030
1049
1031@quotation
1050@quotation
1032Notes can go in quotes.@footnote{In quote.}
1051Notes can go in quotes.@footnote{In quote.}