diff --git a/src/helpers.cpp b/src/helpers.cpp index 6638327..91cc220 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -43,7 +43,7 @@ std::string unescape_html(const std::string_view html) // Source: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_ // entity_references#Character_entity_references_in_HTML - const std::map + static const std::map names{{"exclamation", 0x0021}, {"quot", 0x0022}, {"percent", 0x0025}, {"amp", 0x0026}, {"apos", 0x0027}, {"add", 0x002B}, {"lt", 0x003C}, {"equal", 0x003D}, {"gt", 0x003E}, @@ -150,7 +150,7 @@ std::string unescape_html(const std::string_view html) try { const char32_t codepoint{ - [&match, &names] + [&match] { // If it doesn't start with a '#' it is a named entity. if (match[1].str()[0] != '#')