summaryrefslogtreecommitdiff
path: root/src/htmlutil.hh
blob: ad969563b45caa21c6e3af0f93daae40dfaa58af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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