mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46: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
|
@ -28,7 +28,7 @@ describe('urls', function () {
|
|||
});
|
||||
|
||||
describe('special characters inside URL', function () {
|
||||
for (const char of '-:@_.,~%+/?=&#!;()$\'*') {
|
||||
for (const char of '-:@_.,~%+/?=&#!;()[]$\'*') {
|
||||
const url = `https://etherpad.org/${char}foo`;
|
||||
it(url, async function () {
|
||||
await helper.edit(url);
|
||||
|
@ -41,7 +41,7 @@ describe('urls', function () {
|
|||
});
|
||||
|
||||
describe('punctuation after URL is ignored', function () {
|
||||
for (const char of ':.,;?!)\'*]') {
|
||||
for (const char of ':.,;?!)]\'*') {
|
||||
const want = 'https://etherpad.org';
|
||||
const input = want + char;
|
||||
it(input, async function () {
|
||||
|
@ -53,21 +53,4 @@ describe('urls', function () {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Square brackets are in the RFC3986 reserved set so they can legally appear in URIs, but they
|
||||
// are explicitly excluded from linkification because including them is usually not desired (e.g.,
|
||||
// it can interfere with wiki/markdown link syntax).
|
||||
describe('square brackets are excluded from linkified URLs', function () {
|
||||
for (const char of '[]') {
|
||||
const want = 'https://etherpad.org/';
|
||||
const input = `${want}${char}foo`;
|
||||
it(input, async function () {
|
||||
await helper.edit(input);
|
||||
await helper.waitForPromise(() => txt().find('a').length === 1);
|
||||
const link = txt().find('a');
|
||||
expect(link.attr('href')).to.be(want);
|
||||
expect(link.text()).to.be(want);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue