From 6232d13f5321b87ddf12a1aa36b4545da45f173d Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 17 Nov 2021 22:34:57 +0100 Subject: Travel3: Simple image and video display site Reads the images and videos from filesystem and builds a site in memroy. --- src/htmlutil.hh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/htmlutil.hh (limited to 'src/htmlutil.hh') diff --git a/src/htmlutil.hh b/src/htmlutil.hh new file mode 100644 index 0000000..ad96956 --- /dev/null +++ b/src/htmlutil.hh @@ -0,0 +1,21 @@ +#ifndef HTMLUTIL_HH +#define HTMLUTIL_HH + +#include +#include + +namespace html { + +enum class EscapeTarget { + BODY, + ATTRIBUTE, +}; + +std::string escape(std::string_view in, + EscapeTarget target = EscapeTarget::BODY); +void escape(std::string_view in, std::string* out, + EscapeTarget target = EscapeTarget::BODY); + +} // namespace html + +#endif // HTMLUTIL_HH -- cgit v1.2.3-70-g09d2