Fixed regex to not remove hashes on links beyond the initial one
This commit is contained in:
@@ -9,7 +9,7 @@ interface IInlineLinkProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const InlineLink: React.FC<IInlineLinkProps> = ({ children, href }) => {
|
export const InlineLink: React.FC<IInlineLinkProps> = ({ children, href }) => {
|
||||||
const to = href.replace(/#/, ''); // Remove hash from internal links so that react-scroll can find the target
|
const to = href.replace(/^#/, ''); // Remove initial hash from internal links so that react-scroll can find the target
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link containerId="" offset={-docs.headerOffset} shouldOpenInNewTab={true} to={to} textDecoration="underline">
|
<Link containerId="" offset={-docs.headerOffset} shouldOpenInNewTab={true} to={to} textDecoration="underline">
|
||||||
|
|||||||
Reference in New Issue
Block a user