Merge pull request #957 from umihico/patch-1
Allow line breaks for <a> tags to keep body width on mobile
This commit is contained in:
commit
c97f7f076e
@ -8,14 +8,16 @@ const CustomLink = ({ href, ...rest }: LinkProps & AnchorHTMLAttributes<HTMLAnch
|
||||
const isAnchorLink = href && href.startsWith('#')
|
||||
|
||||
if (isInternalLink) {
|
||||
return <Link href={href} {...rest} />
|
||||
return <Link className="break-words" href={href} {...rest} />
|
||||
}
|
||||
|
||||
if (isAnchorLink) {
|
||||
return <a href={href} {...rest} />
|
||||
return <a className="break-words" href={href} {...rest} />
|
||||
}
|
||||
|
||||
return <a target="_blank" rel="noopener noreferrer" href={href} {...rest} />
|
||||
return (
|
||||
<a className="break-words" target="_blank" rel="noopener noreferrer" href={href} {...rest} />
|
||||
)
|
||||
}
|
||||
|
||||
export default CustomLink
|
||||
|
Loading…
x
Reference in New Issue
Block a user