Skip to content

Commit

Permalink
Fix www links not highlighted
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-gromeyer committed Aug 22, 2023
1 parent 231a188 commit e93567c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions markdownhighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1912,15 +1912,16 @@ void MarkdownHighlighter::highlightInlineRules(const QString &text) {
// Helper function for MarkdownHighlighter::highlightLinkOrImage
bool isLink(const QString &text) {
static const QLatin1String supportedSchemes[] = {
QLatin1String("http://"), QLatin1String("https://"),
QLatin1String("file://"), QLatin1String("ftp://"),
QLatin1String("mailto:"), QLatin1String("tel:"),
QLatin1String("sms:"), QLatin1String("smsto:"),
QLatin1String("data:"), QLatin1String("irc://"),
QLatin1String("gopher://"), QLatin1String("spotify:"),
QLatin1String("steam:"), QLatin1String("bitcoin:"),
QLatin1String("magnet:"), QLatin1String("ed2k://"),
QLatin1String("news:"), QLatin1String("ssh://")};
QLatin1String("http://"), QLatin1String("https://"),
QLatin1String("file://"), QLatin1String("www."),
QLatin1String("ftp://"), QLatin1String("mailto:"),
QLatin1String("tel:"), QLatin1String("sms:"),
QLatin1String("smsto:"), QLatin1String("data:"),
QLatin1String("irc://"), QLatin1String("gopher://"),
QLatin1String("spotify:"), QLatin1String("steam:"),
QLatin1String("bitcoin:"), QLatin1String("magnet:"),
QLatin1String("ed2k://"), QLatin1String("news:"),
QLatin1String("ssh://")};

for (const QLatin1String &scheme : supportedSchemes) {
if (text.startsWith(scheme)) {
Expand Down

0 comments on commit e93567c

Please sign in to comment.