mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
generator: add a simple HTML escaping function
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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. *)
|
||||
|
||||
Reference in New Issue
Block a user