File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ module Text.Pandoc.Writers.Shared (
4343 , unsmartify
4444 , gridTable
4545 , metaValueToInlines
46+ , metaValueToString
4647 , stripLeadingTrailingSpace
4748 , groffEscape
4849 )
@@ -61,6 +62,7 @@ import qualified Text.Pandoc.Builder as Builder
6162import Text.Pandoc.Definition
6263import Text.Pandoc.Options
6364import Text.Pandoc.Pretty
65+ import Text.Pandoc.Shared (stringify )
6466import Text.Pandoc.Walk (query )
6567import Text.Pandoc.UTF8 (toStringLazy )
6668import Text.Pandoc.XML (escapeStringForXML )
@@ -344,6 +346,13 @@ metaValueToInlines (MetaBlocks bs) = query return bs
344346metaValueToInlines (MetaBool b) = [Str $ show b]
345347metaValueToInlines _ = []
346348
349+ metaValueToString :: MetaValue -> String
350+ metaValueToString (MetaString s) = s
351+ metaValueToString (MetaInlines ils) = stringify ils
352+ metaValueToString (MetaBlocks bs) = stringify bs
353+ metaValueToString (MetaBool b) = show b
354+ metaValueToString _ = " "
355+
347356-- | Escape non-ASCII characters using groff \u[..] sequences.
348357groffEscape :: T. Text -> T. Text
349358groffEscape = T. concatMap toUchar
You can’t perform that action at this time.
0 commit comments