Allow <title> to have arguments.
continuous-integration/drone/push Build is passing Details

Fixes title extraction on medium.com posts.
This commit is contained in:
tastytea 2019-12-02 15:41:02 +01:00
parent d264ead7f9
commit b6e7449a6a
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 1 additions and 1 deletions

View File

@ -229,7 +229,7 @@ string URI::extract_title(const string &html) const
const RegEx re_htmlfile(".*\\.(.?html?|xml|rss)$", RegEx::RE_CASELESS);
if (_uri.substr(0, 4) == "http" || re_htmlfile.match(_uri))
{
const RegEx re_title("<title>([^<]+)", RegEx::RE_CASELESS);
const RegEx re_title("<title(?: [^>]+)?>([^<]+)", RegEx::RE_CASELESS);
vector<string> matches;
re_title.split(html, matches);
if (matches.size() >= 2)