+ let error_msg = function
+ | Emphasized_error text -> "<localized>" ^ text ^ "</localized>"
+ | Ambiguous text -> (* <ambiguity> *) text
+ | End_of_file _ -> (* not an error *) ""
+ | e -> (* unmanaged error *)
+ "<error>" ^
+ (Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false ()
+ (Printexc.to_string e)) ^ "</error>"
+ in
+
+ let rec aux acc text =