fix link parser
This commit is contained in:
@@ -10,6 +10,7 @@ namespace chatterino {
|
|||||||
LinkParser::LinkParser(const QString &unparsedString)
|
LinkParser::LinkParser(const QString &unparsedString)
|
||||||
{
|
{
|
||||||
static QRegularExpression linkRegex = [] {
|
static QRegularExpression linkRegex = [] {
|
||||||
|
static QRegularExpression newLineRegex("\r?\n");
|
||||||
QFile tldFile(":/tlds.txt");
|
QFile tldFile(":/tlds.txt");
|
||||||
tldFile.open(QFile::ReadOnly);
|
tldFile.open(QFile::ReadOnly);
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ LinkParser::LinkParser(const QString &unparsedString)
|
|||||||
t1.setCodec("UTF-8");
|
t1.setCodec("UTF-8");
|
||||||
|
|
||||||
// Read the TLDs in and replace the newlines with pipes
|
// Read the TLDs in and replace the newlines with pipes
|
||||||
QString tldData = t1.readAll().replace("\n", "|");
|
QString tldData = t1.readAll().replace(newLineRegex, "|");
|
||||||
|
|
||||||
const QString urlRegExp =
|
const QString urlRegExp =
|
||||||
"^"
|
"^"
|
||||||
|
|||||||
Reference in New Issue
Block a user