- let rec string_of_html_tag = function
- | `T s -> s
- | `L msgs ->
- sprintf "<ul>\n%s\n</ul>"
- (String.concat "\n"
- (List.map
- (fun msg -> sprintf "<li>%s</li>" (string_of_html_tag msg))
- msgs))
- | `BR -> "<br />\n"
- | `DIV (indent, color, tag) ->
- sprintf "<div style=\"%smargin-left:%fcm\">\n%s\n</div>"
- (match color with None -> "" | Some color -> "color: " ^ color ^ "; ")
- (float_of_int indent *. 0.5)
- (string_of_html_tag tag)
- in