git.iko.soy/typeable/pandoc
on master help sign in
Org reader: update emphasis border chars
3a76632Albert Krewinkel
src/Text/Pandoc/Readers/Org/Inlines.hs+3−3
@@ -735,15 +735,15 @@ many1TillNOrLessNewlines n p end = try $
735
735
736-- | Chars allowed to occur before emphasis (spaces and newlines are ok, too)
736-- | Chars allowed to occur before emphasis (spaces and newlines are ok, too)
737emphasisPreChars :: [Char]
737emphasisPreChars :: [Char]
738−emphasisPreChars = "\t \"'({"
738+emphasisPreChars = "-\t ('\"{"
739
739
740-- | Chars allowed at after emphasis
740-- | Chars allowed at after emphasis
741emphasisPostChars :: [Char]
741emphasisPostChars :: [Char]
742−emphasisPostChars = "\t\n !\"'),-.:;?\\}["
742+emphasisPostChars = "-\t\n .,:!?;'\")}["
743
743
744-- | Chars not allowed at the (inner) border of emphasis
744-- | Chars not allowed at the (inner) border of emphasis
745emphasisForbiddenBorderChars :: [Char]
745emphasisForbiddenBorderChars :: [Char]
746−emphasisForbiddenBorderChars = "\t\n\r \"',"
746+emphasisForbiddenBorderChars = "\t\n\r "
747
747
748-- | The maximum number of newlines within
748-- | The maximum number of newlines within
749emphasisAllowedNewlines :: Int
749emphasisAllowedNewlines :: Int
test/Tests/Readers/Org.hs+9−9
@@ -131,18 +131,18 @@ tests =
131 para (spcSep [ emph $ "t/&" <> space <> "a"
131 para (spcSep [ emph $ "t/&" <> space <> "a"
132 , "/"
132 , "/"
133 , "./r/"
133 , "./r/"
134− , "(" <> (strong "l") <> ")"
134+ , "(" <> strong "l" <> ")"
135− , (emph "e") <> "!"
135+ , emph "e" <> "!"
136− , (emph "b") <> "."
136+ , emph "b" <> "."
137 ])
137 ])
138
138
139− , "Quotes are forbidden border chars" =:
139+ , "Quotes are allowed border chars" =:
140− "/'nope/ *nope\"*" =?>
140+ "/'yep/ *sure\"*" =?>
141− para ("/'nope/" <> space <> "*nope\"*")
141+ para (emph "'yep" <> space <> strong "sure\"")
142
142
143− , "Commata are forbidden border chars" =:
143+ , "Spaces are forbidden border chars" =:
144− "/nada,/" =?>
144+ "/nada /" =?>
145− para "/nada,/"
145+ para "/nada /"
146
146
147 , "Markup should work properly after a blank line" =:
147 , "Markup should work properly after a blank line" =:
148 T.unlines ["foo", "", "/bar/"] =?>
148 T.unlines ["foo", "", "/bar/"] =?>