Fix issue on Windows not matching links correctly.

In Windows a carriage return(Hex 0D) is separate from new line(Hex 0A).

Before it was only replacing the new line with |
and leaving it with the carriage return. Linux ignores these by default I think.
So that when on Windows it created improperly formatted data for the regex syntax.

This fix still replaces new line with | but it also removes anything considered a space with \s
This commit is contained in:
Lajamerr Mittesdine 2018-06-29 02:14:04 -04:00 committed by GitHub
parent 712a292d7e
commit 7a4fafa8fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,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(QRegExp("[\\n]"), "|").remove(QRegExp("[\\s]"));
const QString urlRegExp =
"^"