From b6e7449a6ada1ea0c9abb1999d147814750ee0a1 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 2 Dec 2019 15:41:02 +0100 Subject: [PATCH] Allow to have arguments. Fixes title extraction on medium.com posts. --- src/lib/uri.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/uri.cpp b/src/lib/uri.cpp index 4328b7b..ca11dec 100644 --- a/src/lib/uri.cpp +++ b/src/lib/uri.cpp @@ -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)