fix Mastodon link verification

the top element must be a single <a> in order for verification to work, so MfmService has gained an 'inline' argument to remove the <p> added by default
This commit is contained in:
JeDaYoshi 2025-06-22 17:46:52 +00:00
parent a4c0ef824c
commit afd57f99c5
No known key found for this signature in database
GPG key ID: 8060B288C274219D
3 changed files with 15 additions and 3 deletions

View file

@ -63,6 +63,12 @@ describe('MfmService', () => {
const output = '<p><ruby><span><i>some</i> text</span><rp>(</rp><rt>ignore me</rt><rp>)</rp></ruby></p>';
assert.equal(mfmService.toHtml(mfm.parse(input)), output);
});
test('inline', () => {
const input = 'https://example.com';
const output = '<a href="https://example.com">https://example.com</a>';
assert.equal(mfmService.toHtml(mfm.parse(input), [], [], true), output);
});
});
describe('toMastoApiHtml', () => {