@@ -182,11 +182,12 @@ convertWithOpts opts = do
182182 let msOutput = format == "ms"
183183
184184 -- disabling the custom writer for now
185− writer <- if ".lua" `isSuffixOf` format
185+ (writer, writerExts) <-
186+ if ".lua" `isSuffixOf` format
186187 -- note: use non-lowercased version writerName
187188 then return (TextWriter
188189 (\o d -> liftIO $ writeCustom writerName o d)
189− :: Writer PandocIO)
190+ :: Writer PandocIO, mempty)
190191 else case getWriter writerName of
191192 Left e -> E.throwIO $ PandocAppError $
192193 if format == "pdf"
@@ -196,12 +197,13 @@ convertWithOpts opts = do
196197 "\nand specify an output file with " ++
197198 ".pdf extension (-o filename.pdf)."
198199 else e
199− Right w -> return (w :: Writer PandocIO)
200+ Right (w, es) -> return (w :: Writer PandocIO, es)
200201
201202 -- TODO: we have to get the input and the output into the state for
202203 -- the sake of the text2tags reader.
203− reader <- case getReader readerName of
204− Right r -> return (r :: Reader PandocIO)
204+ (reader, readerExts) <-
205+ case getReader readerName of
206+ Right (r, es) -> return (r :: Reader PandocIO, es)
205207 Left e -> E.throwIO $ PandocAppError e'
206208 where e' = case readerName of
207209 "pdf" -> e ++
@@ -310,6 +312,7 @@ convertWithOpts opts = do
310312 optDefaultImageExtension opts
311313 , readerTrackChanges = optTrackChanges opts
312314 , readerAbbreviations = abbrevs
315+ , readerExtensions = readerExts
313316 }
314317
315318 highlightStyle <- lookupHighlightStyle $ optHighlightStyle opts
@@ -340,6 +343,7 @@ convertWithOpts opts = do
340343 writerNumberSections = optNumberSections opts,
341344 writerNumberOffset = optNumberOffset opts,
342345 writerSectionDivs = optSectionDivs opts,
346+ writerExtensions = writerExts,
343347 writerReferenceLinks = optReferenceLinks opts,
344348 writerReferenceLocation = optReferenceLocation opts,
345349 writerDpi = optDpi opts,