fix: clean href

This commit is contained in:
a7m-1st 2025-11-20 23:19:01 +03:00
parent 358f26b521
commit db1d8f8500

View file

@ -128,9 +128,12 @@ export const MarkDown = memo(
const cleanChildren = typeof children === 'string'
? children.replace(/^[.,"'{}()\[\]]+|[.,"'{}()\[\]]+$/g, '')
: children;
const cleanHref = typeof href === 'string'
? href.replace(/^[.,"'{}()\[\]]+|[.,"'{}()\[\]]+$/g, '').replace(/(%[0-9A-Fa-f]{2})+$/g, '')
: href;
return (
<a
href={href}
href={cleanHref}
className="text-blue-600 hover:text-blue-800 underline break-words inline"
style={{ wordBreak: 'break-word', overflowWrap: 'break-word' }}
target="_blank"