Exclude more illegal characters from external links

print-window-tiddler
Jermolene 2014-04-14 11:17:28 +01:00
rodzic 0aa559cd23
commit 4c648e7cdc
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -26,7 +26,7 @@ exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /~?(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s\|'"<>]+(?:\/|\b)/mg;
this.matchRegExp = /~?(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/mg;
};
exports.parse = function() {

Wyświetl plik

@ -28,7 +28,7 @@ exports.init = function(parser) {
};
var isLinkExternal = function(to) {
var externalRegExp = /(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s'"]+(?:\/|\b)/i;
var externalRegExp = /(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s<>{}\[\]`|'"\\^~]+(?:\/|\b)/i;
return externalRegExp.test(to);
};