fix(markdown): Ensure abbr: links render correctly in react-markdown v9+
React-markdown v9 and later versions enforce stricter default URL filtering, which inadvertently removed support for custom URL schemes like 'abbr:'. This commit introduces a `customUrlTransform` function, now located in `markdown-utils.ts`. This function is passed to the `ReactMarkdown` component to: - Explicitly allow the 'abbr:' protocol. - Permit standard safe web protocols (http, https, mailto, xmpp, irc, ircs). - Allow page-local fragments (#), protocol-relative URLs (//), and all purely relative paths. - Disallow other potentially unsafe or unsupported URL schemes. This restores the intended functionality for 'abbr:' links while maintaining robust URL handling and security for the Markdown component.pull/20648/head
parent
d22c351221
commit
f78a4c8aee
Loading…
Reference in New Issue