Skip to content

Commit 26f0f50

Browse files
committed
fix header links
1 parent 6accef4 commit 26f0f50

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

src/components/Breadcrumbs.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { useLocation, Link } from 'react-router-dom';
2+
import { useLocation } from 'react-router-dom';
33
import styles from './Breadcrumbs.module.css';
44

55
const Breadcrumbs = () => {
@@ -16,9 +16,9 @@ const Breadcrumbs = () => {
1616

1717
return (
1818
<nav className={styles.breadcrumbs} aria-label="Breadcrumb">
19-
<Link to="/" className={styles.crumb}>Wiki</Link>
19+
<span className={styles.crumb}>Wiki</span>
2020
<span className={styles.sep}></span>
21-
<Link to={`/wiki/${folder}`} className={styles.crumb}>{folderLabel}</Link>
21+
<span className={styles.crumb}>{folderLabel}</span>
2222
<span className={styles.sep}></span>
2323
<span className={`${styles.crumb} ${styles.current}`}>{pageLabel}</span>
2424
</nav>

src/components/MarkdownViewer.jsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,13 @@ function makeHeading(Tag) {
2828
return (
2929
<div className={styles.headingWrapper}>
3030
<Tag id={slug} {...props}>{children}</Tag>
31-
<a
31+
<button
3232
className={styles.anchorLink}
33-
href={`#${slug}`}
34-
aria-label="Link zu diesem Abschnitt"
35-
onClick={(e) => {
36-
e.preventDefault();
37-
document.getElementById(slug)?.scrollIntoView({ behavior: 'smooth' });
38-
}}
33+
aria-label="Zu diesem Abschnitt scrollen"
34+
onClick={() => document.getElementById(slug)?.scrollIntoView({ behavior: 'smooth' })}
3935
>
4036
<Hash size={14} />
41-
</a>
37+
</button>
4238
</div>
4339
);
4440
};

src/components/MarkdownViewer.module.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@
189189
transition: opacity 0.12s ease, color 0.12s ease;
190190
display: flex;
191191
align-items: center;
192-
text-decoration: none;
192+
background: none;
193+
border: none;
194+
padding: 0;
195+
cursor: pointer;
193196
}
194197

195198
.anchorLink:hover {

0 commit comments

Comments
 (0)