- Timestamp:
- 07/01/2026 10:20:25 PM (2 months ago)
- Branches:
- main
- Children:
- e499b71
- Parents:
- 2abd3d2
- File:
-
- 1 edited
-
test/url-linkify.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/url-linkify.test.js
r2abd3d2 rfc229f5 40 40 }); 41 41 42 test('a URL inside parentheses links, closing paren stays outside', () => { 43 const n = note('<p>site (https://example.com/a) hier</p>'); 44 assert.match(n.content, /\(<a href="https:\/\/example\.com\/a"[^>]*>https:\/\/example\.com\/a<\/a>\)/); 45 }); 46 47 test('a hashtag inside parentheses still links; quoted attribute values never match', () => { 48 const n = note('<p>leuk (#jazz) toch</p>'); 49 assert.match(n.content, /\(<a [^>]*class="mention hashtag"[^>]*>#jazz<\/a>\)/); 50 // A quote precedes attribute values — the prefix class must NOT include quotes. 51 const n2 = note('<p>plaatje <a href="https://x.example/#frag">link</a></p>'); 52 assert.equal((n2.content.match(/<a /g) || []).length, 1, 'href value untouched'); 53 }); 54 42 55 test('attribute values are untouched, standalone URLs still link (image stripped from content)', () => { 43 56 const n = note('<p><img src="https://cdn.example.com/pic.png" alt=""> and https://example.org</p>');
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)