git.iko.soy/typeable/pandoc
on master help sign in
Ms writer: warning for non-rendered raw content.
commitc964898899688f495197f300f05d5ee15beff411 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 24 Mar 2017, 08:52 (10 years ago) parentf0abbe7
1 file changed+10−6
src/Text/Pandoc/Writers/Ms.hs+10−6
src/Text/Pandoc/Writers/Ms.hs+10−6
@@ -29,7 +29,6 @@ Conversion of 'Pandoc' documents to groff man page format.
2929
3030TODO:
3131
32−[ ] warning for non-rendered raw content
3332[ ] is there a better way to do strikeout?
3433[ ] options for hyperlink rendering (currently footnote)
3534[ ] can we get prettier output using .B, etc. instead of
@@ -57,7 +56,8 @@ import Data.List ( stripPrefix, intersperse, intercalate, sort )
5756import Data.Maybe (fromMaybe)
5857import Text.Pandoc.Pretty
5958import Text.Pandoc.Builder (deleteMeta)
60−import Text.Pandoc.Class (PandocMonad)
59+import Text.Pandoc.Class (PandocMonad, report)
60+import Text.Pandoc.Logging
6161import Control.Monad.State
6262import Data.Char ( isDigit, isLower, isUpper, toUpper )
6363import Text.TeXMath (writeEqn)
@@ -223,9 +223,11 @@ blockToMs opts (Para inlines) = do
223223 contents <- liftM vcat $ mapM (inlineListToMs' opts) $
224224 splitSentences inlines
225225 return $ text ".LP" $$ contents
226−blockToMs _ (RawBlock f str)
226+blockToMs _ b@(RawBlock f str)
227227 | f == Format "man" = return $ text str
228− | otherwise = return empty
228+ | otherwise = do
229+ report $ BlockNotRendered b
230+ return empty
229231blockToMs _ HorizontalRule = return $ text ".PP" $$ text " * * * * *"
230232blockToMs opts (Header level _ inlines) = do
231233 contents <- inlineListToMs' opts inlines
@@ -419,9 +421,11 @@ inlineToMs opts (Math DisplayMath str) = do
419421 return $ cr <> text ".RS" $$ contents $$ text ".RE"
420422 Right r -> return $
421423 cr <> text ".EQ" $$ text (escapeBar r) $$ text ".EN"
422−inlineToMs _ (RawInline f str)
424+inlineToMs _ il@(RawInline f str)
423425 | f == Format "man" = return $ text str
424− | otherwise = return empty
426+ | otherwise = do
427+ report $ InlineNotRendered il
428+ return empty
425429inlineToMs _ (LineBreak) = return $ cr <> text ".br" <> cr
426430inlineToMs opts SoftBreak = handleNotes opts cr
427431inlineToMs opts Space = handleNotes opts space