mirror of
https://github.com/aljazceru/ditto.git
synced 2026-02-23 14:06:58 +01:00
Test and fix parsing of URLs
This commit is contained in:
@@ -11,10 +11,15 @@ Deno.test('parseNoteContent', () => {
|
||||
});
|
||||
|
||||
Deno.test('parseNoteContent parses URLs', () => {
|
||||
const { html } = parseNoteContent(`check out my website: https://alexgleason.me`, []);
|
||||
const { html } = parseNoteContent('check out my website: https://alexgleason.me', []);
|
||||
assertEquals(html, 'check out my website: <a href="https://alexgleason.me">https://alexgleason.me</a>');
|
||||
});
|
||||
|
||||
Deno.test('parseNoteContent parses bare URLs', () => {
|
||||
const { html } = parseNoteContent('have you seen ditto.pub?', []);
|
||||
assertEquals(html, 'have you seen <a href="http://ditto.pub">ditto.pub</a>?');
|
||||
});
|
||||
|
||||
Deno.test('parseNoteContent parses mentions with apostrophes', () => {
|
||||
const { html } = parseNoteContent(
|
||||
`did you see nostr:nprofile1qqsqgc0uhmxycvm5gwvn944c7yfxnnxm0nyh8tt62zhrvtd3xkj8fhgprdmhxue69uhkwmr9v9ek7mnpw3hhytnyv4mz7un9d3shjqgcwaehxw309ahx7umywf5hvefwv9c8qtmjv4kxz7gpzemhxue69uhhyetvv9ujumt0wd68ytnsw43z7s3al0v's speech?`,
|
||||
|
||||
Reference in New Issue
Block a user