src/Tools/Haskell/YXML.hs
changeset 69248 9f21381600e3
parent 69228 f4263f7ec9a4
child 69280 e1d01b351724
--- a/src/Tools/Haskell/YXML.hs	Tue Nov 06 14:30:53 2018 +0100
+++ b/src/Tools/Haskell/YXML.hs	Tue Nov 06 14:53:56 2018 +0100
@@ -8,7 +8,7 @@
 inlining into plain text.
 -}
 
-module Isabelle.YXML (charX, charY, strX, strY, detect,
+module Isabelle.YXML (charX, charY, strX, strY, detect, output_markup,
   buffer_body, buffer, string_of_body, string_of, parse_body, parse)
 where
 
@@ -39,6 +39,11 @@
 
 {- output -}
 
+output_markup :: Markup.T -> Markup.Output
+output_markup markup@(name, atts) =
+  if Markup.is_empty markup then Markup.no_output
+  else (strXY ++ name ++ concatMap (\(a, x) -> strY ++ a ++ "=" ++ x) atts ++ strX, strXYX)
+
 buffer_attrib (a, x) =
   Buffer.add strY #> Buffer.add a #> Buffer.add "=" #> Buffer.add x