[Pkg-libvirt-commits] [libguestfs] 14/21: generator: add a simple HTML escaping function
Hilko Bengen
bengen at moszumanska.debian.org
Sun May 3 21:27:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit 5f511215ca3e86ab252f8d52765d88675edc27b1
Author: Pino Toscano <ptoscano at redhat.com>
Date: Tue Feb 10 14:22:14 2015 +0100
generator: add a simple HTML escaping function
(cherry picked from commit 8b268bd8970e183d765850fac09386cc2d32dadc)
---
generator/utils.ml | 8 +++++++-
generator/utils.mli | 3 +++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/generator/utils.ml b/generator/utils.ml
index 9d34918..36a6bea 100644
--- a/generator/utils.ml
+++ b/generator/utils.ml
@@ -372,4 +372,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 8dca20b..add89b6 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. *)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list