git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Support obeylines environment.
7d04388John MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+3
@@ -742,6 +742,9 @@ environments = M.fromList
742 , ("lstlisting", codeBlock <$> (verbEnv "lstlisting"))
742 , ("lstlisting", codeBlock <$> (verbEnv "lstlisting"))
743 , ("minted", liftA2 (\l c -> codeBlockWith ("",[l],[]) c)
743 , ("minted", liftA2 (\l c -> codeBlockWith ("",[l],[]) c)
744 (grouped (many1 $ satisfy (/= '}'))) (verbEnv "minted"))
744 (grouped (many1 $ satisfy (/= '}'))) (verbEnv "minted"))
745+ , ("obeylines", parseFromString
746+ (para . trimInlines . mconcat <$> many inline) =<<
747+ intercalate "\\\\\n" . lines <$> verbEnv "obeylines")
745 , ("displaymath", mathEnv Nothing "displaymath")
748 , ("displaymath", mathEnv Nothing "displaymath")
746 , ("equation", mathEnv Nothing "equation")
749 , ("equation", mathEnv Nothing "equation")
747 , ("equation*", mathEnv Nothing "equation*")
750 , ("equation*", mathEnv Nothing "equation*")
tests/latex-reader.latex+5
@@ -155,6 +155,11 @@ And:
155
155
156These should not be escaped: \$ \\ \> \[ \{
156These should not be escaped: \$ \\ \> \[ \{
157\end{verbatim}
157\end{verbatim}
158+
159+\begin{obeylines}
160+this has \emph{two
161+lines}
162+\end{obeylines}
158\begin{center}\rule{3in}{0.4pt}\end{center}
163\begin{center}\rule{3in}{0.4pt}\end{center}
159
164
160\section{Lists}
165\section{Lists}
tests/latex-reader.native+1
@@ -57,6 +57,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
57,CodeBlock ("",[],[]) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab"
57,CodeBlock ("",[],[]) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab"
58,Para [Str "And:"]
58,Para [Str "And:"]
59,CodeBlock ("",[],[]) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{"
59,CodeBlock ("",[],[]) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{"
60+,Para [Str "this",Space,Str "has",Space,Emph [Str "two",LineBreak,Str "lines"]]
60,HorizontalRule
61,HorizontalRule
61,Header 1 [Str "Lists"]
62,Header 1 [Str "Lists"]
62,Header 2 [Str "Unordered"]
63,Header 2 [Str "Unordered"]