A calm place to write long-form, and publish it to the open social web. skypress.blog/
0

Configure Feed

Select the types of activity you want to include in your feed.

Lock sanitizer: mention link keeps class+href, drops data-did

+10
+10
src/lib/reader/sanitize.test.ts
··· 35 35 expect( clean ).toContain( 'rel="noopener noreferrer nofollow ugc"' ); 36 36 expect( clean ).toContain( 'target="_blank"' ); 37 37 } ); 38 + 39 + it( 'keeps a mention link (class + href) but strips its data-did', () => { 40 + const dirty = 41 + '<p>Hi <a class="skypress-mention" href="https://bsky.app/profile/alice.bsky.social" data-did="did:plc:alice">@alice.bsky.social</a></p>'; 42 + const clean = sanitizeArticleHtml( dirty ); 43 + expect( clean ).toContain( 'class="skypress-mention"' ); 44 + expect( clean ).toContain( 'href="https://bsky.app/profile/alice.bsky.social"' ); 45 + expect( clean ).not.toContain( 'data-did' ); 46 + expect( clean ).toContain( '@alice.bsky.social' ); 47 + } ); 38 48 } );