@@ -29,6 +29,7 @@ Define the Org-mode parser state.
30module Text.Pandoc.Readers.Org.ParserState
30module Text.Pandoc.Readers.Org.ParserState
31 ( OrgParserState (..)
31 ( OrgParserState (..)
32+ , defaultOrgParserState
32 , OrgParserLocal (..)
33 , OrgParserLocal (..)
33 , OrgNoteRecord
34 , OrgNoteRecord
34 , HasReaderOptions (..)
35 , HasReaderOptions (..)
@@ -104,6 +105,11 @@ type TodoSequence = [TodoMarker]
104data OrgParserState = OrgParserState
105data OrgParserState = OrgParserState
105 { orgStateAnchorIds :: [String]
106 { orgStateAnchorIds :: [String]
106 , orgStateEmphasisCharStack :: [Char]
107 , orgStateEmphasisCharStack :: [Char]
108+ , orgStateEmphasisPreChars :: [Char] -- ^ Chars allowed to occur before
109+ -- emphasis; spaces and newlines are
110+ -- always ok in addition to what is
112+ , orgStateEmphasisPostChars :: [Char] -- ^ Chars allowed at after emphasis
107 , orgStateEmphasisNewlines :: Maybe Int
113 , orgStateEmphasisNewlines :: Maybe Int
108 , orgStateExportSettings :: ExportSettings
114 , orgStateExportSettings :: ExportSettings
109 , orgStateHeaderMap :: M.Map Inlines String
115 , orgStateHeaderMap :: M.Map Inlines String
@@ -124,7 +130,9 @@ data OrgParserState = OrgParserState
124 , orgMacros :: M.Map Text Macro
130 , orgMacros :: M.Map Text Macro
127−data OrgParserLocal = OrgParserLocal { orgLocalQuoteContext :: QuoteContext }
133+data OrgParserLocal = OrgParserLocal
134+ { orgLocalQuoteContext :: QuoteContext
129instance Default OrgParserLocal where
137instance Default OrgParserLocal where
130 def = OrgParserLocal NoQuote
138 def = OrgParserLocal NoQuote
@@ -168,6 +176,8 @@ instance Default OrgParserState where
168defaultOrgParserState :: OrgParserState
176defaultOrgParserState :: OrgParserState
169defaultOrgParserState = OrgParserState
177defaultOrgParserState = OrgParserState
170 { orgStateAnchorIds = []
178 { orgStateAnchorIds = []
179+ , orgStateEmphasisPreChars = "-\t ('\"{"
180+ , orgStateEmphasisPostChars = "-\t\n .,:!?;'\")}["
171 , orgStateEmphasisCharStack = []
181 , orgStateEmphasisCharStack = []
172 , orgStateEmphasisNewlines = Nothing
182 , orgStateEmphasisNewlines = Nothing
173 , orgStateExportSettings = def
183 , orgStateExportSettings = def