diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-08-14 09:49:31 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-08-14 09:49:31 -0700 |
commit | e917bcc124b9e1a8f4ce046d4ad7e6f817631666 (patch) | |
tree | 34099a1fabccf74138c1360309beb123d72c5eea | |
parent | 8c1e0543d7b62d8d7a3322fdc1e283bcfa458552 (diff) | |
download | pandoc-e917bcc124b9e1a8f4ce046d4ad7e6f817631666.tar.gz |
Make `raw_tex` extension non-default for textile reader, writer.
Enable `raw_tex` extension in textile writer.
Closes #1532.
-rw-r--r-- | changelog | 5 | ||||
-rw-r--r-- | src/Text/Pandoc.hs | 3 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Textile.hs | 4 | ||||
-rw-r--r-- | tests/textile-reader.native | 4 | ||||
-rw-r--r-- | tests/textile-reader.textile | 11 |
5 files changed, 9 insertions, 18 deletions
@@ -89,6 +89,11 @@ pandoc (1.13) `\cite{Coffee}`), can be used without any further escaping (Albert Krewinkel). + * Textile reader and writer: + + + The `raw_tex` extension is no longer set by default. You can + enable it with `textile+raw_tex`. + * DocBook reader: + Support `equation`, `informalequation`, `inlineequation` elements with diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs index c7c64f0fc..fd849316b 100644 --- a/src/Text/Pandoc.hs +++ b/src/Text/Pandoc.hs @@ -304,8 +304,7 @@ getDefaultExtensions "markdown_github" = githubMarkdownExtensions getDefaultExtensions "markdown" = pandocExtensions getDefaultExtensions "plain" = pandocExtensions getDefaultExtensions "org" = Set.fromList [Ext_citations] -getDefaultExtensions "textile" = Set.fromList [Ext_auto_identifiers, - Ext_raw_tex] +getDefaultExtensions "textile" = Set.fromList [Ext_auto_identifiers] getDefaultExtensions "html" = Set.fromList [Ext_auto_identifiers, Ext_native_divs, Ext_native_spans] diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs index 3a6982a01..20cb5f6f7 100644 --- a/src/Text/Pandoc/Writers/Textile.hs +++ b/src/Text/Pandoc/Writers/Textile.hs @@ -404,8 +404,10 @@ inlineToTextile _ (Str str) = return $ escapeStringForTextile str inlineToTextile _ (Math _ str) = return $ "<span class=\"math\">" ++ escapeStringForXML str ++ "</math>" -inlineToTextile _ (RawInline f str) +inlineToTextile opts (RawInline f str) | f == Format "html" || f == Format "textile" = return str + | (f == Format "latex" || f == Format "tex") && + isEnabled Ext_raw_tex opts = return str | otherwise = return "" inlineToTextile _ (LineBreak) = return "\n" diff --git a/tests/textile-reader.native b/tests/textile-reader.native index 0a0b10bd3..de0637f5f 100644 --- a/tests/textile-reader.native +++ b/tests/textile-reader.native @@ -155,10 +155,6 @@ Pandoc (Meta {unMeta = fromList []}) [[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>"]] ,[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>"]]] ,Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"] -,Header 1 ("raw-latex",[],[]) [Str "Raw",Space,Str "LaTeX"] -,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 ":"] -,RawBlock (Format "latex") "\\begin{itemize}\n \\item one\n \\item two\n\\end{itemize}" -,Para [Str "and",Space,Str "for",Space,RawInline (Format "latex") "\\emph{inlines}",Str "."] ,Header 1 ("acronyms-and-marks",[],[]) [Str "Acronyms",Space,Str "and",Space,Str "marks"] ,Para [Str "PBS (Public Broadcasting System)"] ,Para [Str "Hi\8482"] diff --git a/tests/textile-reader.textile b/tests/textile-reader.textile index e1e143531..dab73b39f 100644 --- a/tests/textile-reader.textile +++ b/tests/textile-reader.textile @@ -235,17 +235,6 @@ Html blocks can be <div>inlined</div> as well. Can you prove that 2 < 3 ? -h1. Raw LaTeX - -This Textile reader also accepts raw LaTeX for blocks : - -\begin{itemize} - \item one - \item two -\end{itemize} - -and for \emph{inlines}. - h1. Acronyms and marks PBS(Public Broadcasting System) |