mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-29 20:51:43 +00:00
Exclude more illegal characters from external links
This commit is contained in:
@@ -26,7 +26,7 @@ exports.types = {inline: true};
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// 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() {
|
exports.parse = function() {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ exports.init = function(parser) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var isLinkExternal = function(to) {
|
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);
|
return externalRegExp.test(to);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user