git.iko.soy/typeable/pandoc
on master help sign in
Org reader: use custom `anyLine`
26e8d98Albert Krewinkel
src/Text/Pandoc/Readers/Org.hs+10−3
@@ -37,8 +37,9 @@ import Text.Pandoc.Error
37import Text.Pandoc.Options
37import Text.Pandoc.Options
38import qualified Text.Pandoc.Parsing as P
38import qualified Text.Pandoc.Parsing as P
39import Text.Pandoc.Parsing hiding ( F, unF, askF, asksF, runF
39import Text.Pandoc.Parsing hiding ( F, unF, askF, asksF, runF
40+ , anyLine, blanklines, newline
40− , newline, orderedListMarker
41+ , orderedListMarker
41− , parseFromString, blanklines
42+ , parseFromString
42 )
43 )
43import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)
44import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline)
44import Text.Pandoc.Readers.Org.ParserState
45import Text.Pandoc.Readers.Org.ParserState
@@ -247,6 +248,12 @@ blanklines =
247 <* updateLastPreCharPos
248 <* updateLastPreCharPos
248 <* updateLastForbiddenCharPos
249 <* updateLastForbiddenCharPos
249
250
251+anyLine :: OrgParser String
252+anyLine =
253+ P.anyLine
254+ <* updateLastPreCharPos
255+ <* updateLastForbiddenCharPos
256+
250-- | Succeeds when we're in list context.
257-- | Succeeds when we're in list context.
251inList :: OrgParser ()
258inList :: OrgParser ()
252inList = do
259inList = do
@@ -304,7 +311,7 @@ stringyMetaAttribute attrCheck = try $ do
304 attrName <- map toUpper <$> many1Till nonspaceChar (char ':')
311 attrName <- map toUpper <$> many1Till nonspaceChar (char ':')
305 guard $ attrCheck attrName
312 guard $ attrCheck attrName
306 skipSpaces
313 skipSpaces
307− attrValue <- manyTill anyChar newline
314+ attrValue <- anyLine
308 return (attrName, attrValue)
315 return (attrName, attrValue)
309
316
310blockAttributes :: OrgParser BlockAttributes
317blockAttributes :: OrgParser BlockAttributes