summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-10-04 22:09:23 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-10-04 22:09:23 +0000
commit74ac66a0cbb2c61a55f6d98128272d3568b0ead5 (patch)
treed48eb75eed203372672177a1dfe9fd3e16a3708a /src/Text/Pandoc
parent6191a1fa745c067d3df153b244e9829255600f5d (diff)
Added haddock comments warning that readers assume \n line endings.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1608 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs2
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs2
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs4
-rw-r--r--src/Text/Pandoc/Readers/RST.hs4
-rw-r--r--src/Text/Pandoc/Readers/TeXMath.hs3
5 files changed, 10 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 506f77d1b..2e38da722 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -52,7 +52,7 @@ import Network.URI ( parseURIReference, URI (..) )
-- | Convert HTML-formatted string to 'Pandoc' document.
readHtml :: ParserState -- ^ Parser state
- -> String -- ^ String to parse
+ -> String -- ^ String to parse (assumes @'\n'@ line endings)
-> Pandoc
readHtml = readWith parseHtml
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 5d02a2be5..c6e28cd45 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -42,7 +42,7 @@ import Data.List ( isPrefixOf, isSuffixOf )
-- | Parse LaTeX from string and return 'Pandoc' document.
readLaTeX :: ParserState -- ^ Parser state, including options for parser
- -> String -- ^ String to parse
+ -> String -- ^ String to parse (assumes @'\n'@ line endings)
-> Pandoc
readLaTeX = readWith parseLaTeX
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index ae682e72e..80bc53966 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -48,7 +48,9 @@ import Text.ParserCombinators.Parsec
import Control.Monad (when)
-- | Read markdown from an input string and return a Pandoc document.
-readMarkdown :: ParserState -> String -> Pandoc
+readMarkdown :: ParserState -- ^ Parser state, including options for parser
+ -> String -- ^ String to parse (assuming @'\n'@ line endings)
+ -> Pandoc
readMarkdown state s = (readWith parseMarkdown) state (s ++ "\n\n")
--
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 884d6f0e6..097d271cb 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -37,7 +37,9 @@ import Control.Monad ( when )
import Data.List ( findIndex, delete, intercalate )
-- | Parse reStructuredText string and return Pandoc document.
-readRST :: ParserState -> String -> Pandoc
+readRST :: ParserState -- ^ Parser state, including options for parser
+ -> String -- ^ String to parse (assuming @'\n'@ line endings)
+ -> Pandoc
readRST state s = (readWith parseRST) state (s ++ "\n\n")
--
diff --git a/src/Text/Pandoc/Readers/TeXMath.hs b/src/Text/Pandoc/Readers/TeXMath.hs
index 04b0f3b8f..2f35910ce 100644
--- a/src/Text/Pandoc/Readers/TeXMath.hs
+++ b/src/Text/Pandoc/Readers/TeXMath.hs
@@ -35,7 +35,8 @@ import Text.ParserCombinators.Parsec
import Text.Pandoc.Definition
-- | Converts a string of raw TeX math to a list of 'Pandoc' inlines.
-readTeXMath :: String -> [Inline]
+readTeXMath :: String -- ^ String to parse (assumes @'\n'@ line endings)
+ -> [Inline]
readTeXMath inp = case parse teXMath ("formula: " ++ inp) inp of
Left _ -> [Str inp] -- if unparseable, just include original
Right res -> res