Added option to escape URL from being linked automatically by prefixing it with a exclamation mark: !http://antville.org
This commit is contained in:
parent
9923a0e0e7
commit
e8c6ca163c
1 changed files with 4 additions and 1 deletions
|
|
@ -479,8 +479,11 @@ Story.prototype.url_filter = function(value, param, mode) {
|
|||
param.limit || (param.limit = 50);
|
||||
// FIXME: The first RegExp has troubles with <a href=http://... (no quotes)
|
||||
//var re = /(^|\/>|\s+)([\w+-_]+:\/\/[^\s]+?)([\.,;:\)\]\"]?)(?=[\s<]|$)/gim;
|
||||
var re = /(^|\/>|\s+)([fhtpsr]+:\/\/[^\s]+?)([\.,;:\)\]\"]?)(?=[\s<]|$)/gim
|
||||
var re = /(^|\/>|\s+)([!fhtpsr]+:\/\/[^\s]+?)([\.,;:\)\]\"]?)(?=[\s<]|$)/gim
|
||||
return value.replace(re, function(str, head, url, tail) {
|
||||
if (url.startsWith("!")) {
|
||||
return head + url.substring(1) + tail;
|
||||
}
|
||||
res.push();
|
||||
res.write(head);
|
||||
if (mode === "plain") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue