mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Add '
and *
to acceptable URL characters
These characters are in the RFC3986 reserved set. These characters are added to the set of characters that cannot be the last character of a URL to avoid mislinkification.
This commit is contained in:
parent
7d23278ed0
commit
a44debdcfe
2 changed files with 4 additions and 4 deletions
|
@ -60,10 +60,10 @@ const wordCharRegex = new RegExp(`[${[
|
|||
const urlRegex = (() => {
|
||||
// TODO: wordCharRegex matches many characters that are not permitted in URIs. Are they included
|
||||
// here as an attempt to support IRIs? (See https://tools.ietf.org/html/rfc3987.)
|
||||
const urlChar = `[-:@_.,~%+/?=&#!;()$${wordCharRegex.source.slice(1, -1)}]`;
|
||||
const urlChar = `[-:@_.,~%+/?=&#!;()$'*${wordCharRegex.source.slice(1, -1)}]`;
|
||||
// Matches a single character that should not be considered part of the URL if it is the last
|
||||
// character that matches urlChar.
|
||||
const postUrlPunct = '[:.,;?!)]';
|
||||
const postUrlPunct = '[:.,;?!)\'*]';
|
||||
// Schemes that must be followed by ://
|
||||
const withAuth = `(?:${[
|
||||
'(?:x-)?man',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue