mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-29 19:15:39 +00:00
fix: clean href
This commit is contained in:
parent
358f26b521
commit
db1d8f8500
1 changed files with 4 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue