git.iko.soy/typeable/pandoc
on master help sign in
Org reader: Better module description, minor style changes
346bceaAlbert Krewinkel
src/Text/Pandoc/Readers/Org.hs+6−6
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
24
25 Maintainer : Albert Krewinkel <tarleb@moltkeplatz.de>
25 Maintainer : Albert Krewinkel <tarleb@moltkeplatz.de>
26
26
27−Conversion of Org-Mode to 'Pandoc' document.
27+Conversion of org-mode formatted plain text to 'Pandoc' document.
28-}
28-}
29module Text.Pandoc.Readers.Org ( readOrg ) where
29module Text.Pandoc.Readers.Org ( readOrg ) where
30
30
@@ -711,7 +711,7 @@ math1CharBetween c = try $ do
711 char c
711 char c
712 res <- noneOf $ c:mathForbiddenBorderChars
712 res <- noneOf $ c:mathForbiddenBorderChars
713 char c
713 char c
714− eof <|> lookAhead (oneOf mathPostChars) *> return ()
714+ eof <|> () <$ lookAhead (oneOf mathPostChars)
715 return [res]
715 return [res]
716
716
717rawMathBetween :: String
717rawMathBetween :: String
@@ -734,12 +734,12 @@ emphasisEnd :: Char -> OrgParser Char
734emphasisEnd c = try $ do
734emphasisEnd c = try $ do
735 guard =<< notAfterForbiddenBorderChar
735 guard =<< notAfterForbiddenBorderChar
736 char c
736 char c
737− eof <|> lookAhead (surroundingEmphasisChar >>= \x ->
737+ eof <|> () <$ lookAhead acceptablePostChars
738− oneOf (x ++ emphasisPostChars))
739− *> return ()
740 updateLastStrPos
738 updateLastStrPos
741 popInlineCharStack
739 popInlineCharStack
742 return c
740 return c
741+ where acceptablePostChars =
742+ surroundingEmphasisChar >>= \x -> oneOf (x ++ emphasisPostChars)
743
743
744mathStart :: Char -> OrgParser Char
744mathStart :: Char -> OrgParser Char
745mathStart c = try $
745mathStart c = try $
@@ -749,7 +749,7 @@ mathEnd :: Char -> OrgParser Char
749mathEnd c = try $ do
749mathEnd c = try $ do
750 res <- noneOf (c:mathForbiddenBorderChars)
750 res <- noneOf (c:mathForbiddenBorderChars)
751 char c
751 char c
752− eof <|> lookAhead (oneOf mathPostChars *> pure ())
752+ eof <|> () <$ lookAhead (oneOf mathPostChars)
753 return res
753 return res
754
754
755
755