git.iko.soy/typeable/pandoc
on master help sign in
Make `raw_tex` extension non-default for textile reader, writer.

Enable `raw_tex` extension in textile writer. Closes #1532.

commite917bcc124b9e1a8f4ce046d4ad7e6f817631666 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 14 Aug 2014, 09:49 (12 years ago) parent8c1e054
5 files changed+9−18
changelog+5 src/Text/Pandoc.hs+1−2 src/Text/Pandoc/Writers/Textile.hs+3−1 tests/textile-reader.native−4 tests/textile-reader.textile−11
changelog+5
@@ -89,6 +89,11 @@ pandoc (1.13)
8989 `\cite{Coffee}`), can be used without any further escaping (Albert
9090 Krewinkel).
9191
92+ * Textile reader and writer:
93+
94+ + The `raw_tex` extension is no longer set by default. You can
95+ enable it with `textile+raw_tex`.
96+
9297 * DocBook reader:
9398
9499 + Support `equation`, `informalequation`, `inlineequation` elements with
src/Text/Pandoc.hs+1−2
@@ -304,8 +304,7 @@ getDefaultExtensions "markdown_github" = githubMarkdownExtensions
304304getDefaultExtensions "markdown" = pandocExtensions
305305getDefaultExtensions "plain" = pandocExtensions
306306getDefaultExtensions "org" = Set.fromList [Ext_citations]
307−getDefaultExtensions "textile" = Set.fromList [Ext_auto_identifiers,
308− Ext_raw_tex]
307+getDefaultExtensions "textile" = Set.fromList [Ext_auto_identifiers]
309308getDefaultExtensions "html" = Set.fromList [Ext_auto_identifiers,
310309 Ext_native_divs,
311310 Ext_native_spans]
src/Text/Pandoc/Writers/Textile.hs+3−1
@@ -404,8 +404,10 @@ inlineToTextile _ (Str str) = return $ escapeStringForTextile str
404404inlineToTextile _ (Math _ str) =
405405 return $ "<span class=\"math\">" ++ escapeStringForXML str ++ "</math>"
406406
407−inlineToTextile _ (RawInline f str)
407+inlineToTextile opts (RawInline f str)
408408 | f == Format "html" || f == Format "textile" = return str
409+ | (f == Format "latex" || f == Format "tex") &&
410+ isEnabled Ext_raw_tex opts = return str
409411 | otherwise = return ""
410412
411413inlineToTextile _ (LineBreak) = return "\n"
tests/textile-reader.native−4
@@ -155,10 +155,6 @@ Pandoc (Meta {unMeta = fromList []})
155155 [[Plain [Str "this",Space,RawInline (Format "html") "<div>",Space,Str "won\8217t",Space,Str "produce",Space,Str "raw",Space,Str "html",Space,Str "blocks",Space,RawInline (Format "html") "</div>"]]
156156 ,[Plain [Str "but",Space,Str "this",Space,RawInline (Format "html") "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,RawInline (Format "html") "</strong>"]]]
157157,Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"]
158−,Header 1 ("raw-latex",[],[]) [Str "Raw",Space,Str "LaTeX"]
159−,Para [Str "This",Space,Str "Textile",Space,Str "reader",Space,Str "also",Space,Str "accepts",Space,Str "raw",Space,Str "LaTeX",Space,Str "for",Space,Str "blocks",Space,Str ":"]
160−,RawBlock (Format "latex") "\\begin{itemize}\n \\item one\n \\item two\n\\end{itemize}"
161−,Para [Str "and",Space,Str "for",Space,RawInline (Format "latex") "\\emph{inlines}",Str "."]
162158,Header 1 ("acronyms-and-marks",[],[]) [Str "Acronyms",Space,Str "and",Space,Str "marks"]
163159,Para [Str "PBS (Public Broadcasting System)"]
164160,Para [Str "Hi\8482"]
tests/textile-reader.textile−11
@@ -235,17 +235,6 @@ Html blocks can be <div>inlined</div> as well.
235235
236236Can you prove that 2 < 3 ?
237237
238−h1. Raw LaTeX
239−
240−This Textile reader also accepts raw LaTeX for blocks :
241−
242−\begin{itemize}
243− \item one
244− \item two
245−\end{itemize}
246−
247−and for \emph{inlines}.
248−
249238h1. Acronyms and marks
250239
251240PBS(Public Broadcasting System)