let esc x =
let fn a c = match c with
| '&' -> a ^ "&"
| '<' -> a ^ "<"
| '"' -> a ^ """
| '\''-> a ^ "'"
| x -> a ^ String.make 1 x
in
Seq.fold_left fn "" (String.to_seq x)
type t = string
let blank_line a = a ^ ""
let plain_text s a = a ^ esc s
let sentence_s a = a ^ ""
let sentence_e a = a ^ " "
let sentence_segment s a = a ^ esc s ^ " "
let reference_name n a = a ^ {||} ^ esc n ^ ""
let bracketed_referent_s n a = a ^ {||} ^ esc n ^ ": "
let bracketed_referent_e a = a ^ "
"
let angled_uri u a = a ^ {|<|} ^ esc u ^ {|>|}
let bold t a = a ^ "" ^ esc t ^ ""
let italic t a = a ^ "" ^ esc t ^ ""
let underline t a = a ^ "" ^ esc t ^ ""
let inline_monospace t a = a ^ "" ^ esc t ^ "
"
let heading_hashbang lvl h a =
let lvl = string_of_int lvl in
a ^ "
" let paragraph_e a = a ^ "
" let preformatted s a = a ^ "" ^ esc s ^ "" let bullet_list_s a = a ^ "