diff --git a/generator/utils.ml b/generator/utils.ml index b24ba8c9e..3a6208450 100644 --- a/generator/utils.ml +++ b/generator/utils.ml @@ -360,4 +360,10 @@ let args_of_optargs optargs = | OInt64 n -> Int64 n | OString n -> String n | OStringList n -> StringList n - ) optargs; + ) optargs + +let html_escape text = + let text = replace_str text "&" "&" in + let text = replace_str text "<" "<" in + let text = replace_str text ">" ">" in + text diff --git a/generator/utils.mli b/generator/utils.mli index 5fd40ce20..e0f30c3e4 100644 --- a/generator/utils.mli +++ b/generator/utils.mli @@ -131,3 +131,6 @@ val spaces : int -> string val args_of_optargs : Types.optargs -> Types.args (** Convert a list of optargs into an equivalent list of args *) + +val html_escape : string -> string +(** Escape a text for HTML display. *)