git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #2505 from tarleb/org-header-markup-fix

Org reader: fix markup parsing in headers

commit237c10992e4cf22a8dd64b385fc44168468021c6 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 8 Nov 2015, 17:17 (11 years ago) parentc423dbbe3b4844
2 files changed+12−1
src/Text/Pandoc/Readers/Org.hs+1−1 tests/Tests/Readers/Org.hs+11
src/Text/Pandoc/Readers/Org.hs+1−1
@@ -731,7 +731,7 @@ headerTags = try $
731731
732732headerStart :: OrgParser Int
733733headerStart = try $
734− (length <$> many1 (char '*')) <* many1 (char ' ')
734+ (length <$> many1 (char '*')) <* many1 (char ' ') <* updateLastPreCharPos
735735
736736
737737-- Don't use (or need) the reader wrapper here, we want hline to be
tests/Tests/Readers/Org.hs+11
@@ -540,6 +540,17 @@ tests =
540540 "* This: is not: tagged" =?>
541541 headerWith ("this-is-not-tagged", [], []) 1 "This: is not: tagged"
542542
543+ , "Header starting with strokeout text" =:
544+ unlines [ "foo"
545+ , ""
546+ , "* +thing+ other thing"
547+ ] =?>
548+ mconcat [ para "foo"
549+ , headerWith ("thing-other-thing", [], [])
550+ 1
551+ ((strikeout "thing") <> " other thing")
552+ ]
553+
543554 , "Comment Trees" =:
544555 unlines [ "* COMMENT A comment tree"
545556 , " Not much going on here"