From ec4c2434552df33301c4354fba88989ba04ac5cc Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Fri, 29 Jun 2018 10:22:09 +0200 Subject: [PATCH] fix link parser --- src/common/LinkParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/LinkParser.cpp b/src/common/LinkParser.cpp index 1c081d8d9..5580a69c0 100644 --- a/src/common/LinkParser.cpp +++ b/src/common/LinkParser.cpp @@ -10,6 +10,7 @@ namespace chatterino { LinkParser::LinkParser(const QString &unparsedString) { static QRegularExpression linkRegex = [] { + static QRegularExpression newLineRegex("\r?\n"); QFile tldFile(":/tlds.txt"); tldFile.open(QFile::ReadOnly); @@ -17,7 +18,7 @@ LinkParser::LinkParser(const QString &unparsedString) t1.setCodec("UTF-8"); // 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 = "^"