mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Add support for square brackets in URLs
This reverts commit 9022877cc6
.
This commit is contained in:
parent
09f8ffbdb6
commit
336d48add7
2 changed files with 4 additions and 21 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