enhanced unescape_html

This commit is contained in:
tastytea 2018-04-14 14:42:15 +02:00
parent c187837f8d
commit 9f730e4ff0
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7) cmake_minimum_required (VERSION 3.7)
project (mastorss project (mastorss
VERSION 0.5.1 VERSION 0.5.2
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -40,7 +40,7 @@ void unescape_html(string &str)
str = ""; str = "";
// Used to convert int to utf-8 char // Used to convert int to utf-8 char
std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> u8c; std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> u8c;
std::regex reentity("&#(\\d{4});"); std::regex reentity("&#(\\d{2,4});");
std::smatch match; std::smatch match;
while (std::regex_search(html, match, reentity)) while (std::regex_search(html, match, reentity))