Skip to content

Commit

Permalink
Merge pull request #358 from stigger/master
Browse files Browse the repository at this point in the history
Linkify URLs with "file:" scheme
  • Loading branch information
Ri0n committed Apr 8, 2018
2 parents 6e4d934 + ee00b11 commit 51ea60c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/textutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@ QString TextUtil::linkify(const QString &in)
isUrl = true;
href = "";
}
else if(linkify_pmatch(out, n, "file://")) {
n += 7;
isUrl = true;
href = "";
}
else if (linkify_pmatch(out, n, "magnet:")) {
n += 7;
isUrl = true;
Expand Down
2 changes: 1 addition & 1 deletion themes/chatview/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function initPsiTheme() {
var linkEl = links[li];
if (youtube.indexOf(linkEl.hostname) != -1) {
chat.util.replaceYoutube(linkEl);
} else if ((linkEl.protocol == "http:" || linkEl.protocol == "https:") && linkEl.hostname != "psi") {
} else if ((linkEl.protocol == "http:" || linkEl.protocol == "https:" || linkEl.protocol == "file:") && linkEl.hostname != "psi") {
chat.util.replaceLinkAsync(linkEl);
}
}
Expand Down

0 comments on commit 51ea60c

Please sign in to comment.