diff options
Diffstat (limited to 'src/htmlutil.hh')
| -rw-r--r-- | src/htmlutil.hh | 21 |
1 files changed, 21 insertions, 0 deletions
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 <string> +#include <string_view> + +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 |
