src/Pure/Thy/html.ML
changeset 14992 a16bc5abad45
parent 14981 e73f8140af78
child 15336 cb35ae957c65
equal deleted inserted replaced
14991:26fb63c4acb5 14992:a16bc5abad45
   223 
   223 
   224   fun scripts ss = #2 (foldl_map script (0, ss @ [""]));
   224   fun scripts ss = #2 (foldl_map script (0, ss @ [""]));
   225 in
   225 in
   226 
   226 
   227 fun output_width str =
   227 fun output_width str =
   228   if not (exists_string (equal "<" orf equal ">" orf equal "&") str)
   228   if not (exists_string (equal "\\" orf equal "<" orf equal ">" orf equal "&") str)
   229   then (str, real (size str))
   229   then Symbol.default_output str
   230   else
   230   else
   231     let val (width, syms) = foldl_map add_sym (0.0, map output_sym (Symbol.explode str))
   231     let val (width, syms) = foldl_map add_sym (0.0, map output_sym (Symbol.explode str))
   232     in (implode (scripts syms), width) end;
   232     in (implode (scripts syms), width) end;
   233 
   233 
   234 val output = #1 o output_width;
   234 val output = #1 o output_width;