summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.hs3
-rw-r--r--src/Text/Pandoc.hs4
2 files changed, 6 insertions, 1 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 30c575a69..b16bfab78 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -876,6 +876,7 @@ defaultReaderName fallback (x:xs) =
".native" -> "native"
".json" -> "json"
".docx" -> "docx"
+ ".t2t" -> "t2t"
_ -> defaultReaderName fallback xs
-- Returns True if extension of first source is .lhs
@@ -1181,7 +1182,7 @@ main = do
let readFiles [] = error "Cannot read archive from stdin"
readFiles (x:_) = B.readFile x
- let convertTabs = tabFilter (if preserveTabs then 0 else tabStop)
+ let convertTabs = tabFilter (if (preserveTabs || readerName' == "t2t") then 0 else tabStop)
let handleIncludes' = if readerName' == "latex" || readerName' == "latex+lhs"
then handleIncludes
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs
index b303fa7d7..15880c39a 100644
--- a/src/Text/Pandoc.hs
+++ b/src/Text/Pandoc.hs
@@ -76,6 +76,8 @@ module Text.Pandoc
, readHaddock
, readNative
, readJSON
+ , readTxt2Tags
+ , readTxt2TagsNoMacros
-- * Writers: converting /from/ Pandoc format
, Writer (..)
, writeNative
@@ -130,6 +132,7 @@ import Text.Pandoc.Readers.Textile
import Text.Pandoc.Readers.Native
import Text.Pandoc.Readers.Haddock
import Text.Pandoc.Readers.Docx
+import Text.Pandoc.Readers.Txt2Tags
import Text.Pandoc.Writers.Native
import Text.Pandoc.Writers.Markdown
import Text.Pandoc.Writers.RST
@@ -227,6 +230,7 @@ readers = [ ("native" , StringReader $ \_ s -> return $ readNative s)
,("latex" , mkStringReader readLaTeX)
,("haddock" , mkStringReader readHaddock)
,("docx" , mkBSReader readDocx)
+ ,("t2t" , mkStringReader readTxt2Tags)
]
data Writer = PureStringWriter (WriterOptions -> Pandoc -> String)