diff --git a/source/generate/parseMarkdown.ts b/source/generate/parseMarkdown.ts index 91e9b7b..0593ddd 100644 --- a/source/generate/parseMarkdown.ts +++ b/source/generate/parseMarkdown.ts @@ -6,8 +6,8 @@ import markDownItMark from "markdown-it-mark" // text highlighting import markdownItSub from "markdown-it-sub" // markdown subscript import markdownItSup from "markdown-it-sup" // markdown superscript import highlightLines from "markdown-it-highlight-lines" // highlighting specific lines in code blocks -import hljs from "highlight.js" // code block syntax highlighting +import hljs from "highlight.js" // code block syntax highlighting import katex from "katex" // rendering mathematical expression import "katex/contrib/mhchem" // chemical formula @@ -31,8 +31,12 @@ const md = markdownIt({ engine: katex, delimiters: "dollars", }) + .use(markdownItAnchor, { + permalink: true, + permalinkBefore: true, + permalinkSymbol: "#", + }) .use(markdownItTaskCheckbox) - .use(markdownItAnchor, {}) .use(markDownItMark) .use(markdownItSub) .use(markdownItSup) diff --git a/source/src/App.tsx b/source/src/App.tsx index a557773..de98e46 100644 --- a/source/src/App.tsx +++ b/source/src/App.tsx @@ -19,10 +19,6 @@ import NotFound from "./pages/NotFound" import theming from "./styles/theming" import GlobalStyle from "./styles/globalStyle" -// Theme that will be used throughout the website -// wrapping it using css because prettier extension does not work well with styled-components -// https://github.com/styled-components/vscode-styled-components/issues/175 - const IENotSupported = styled.p` margin: auto; font-size: 2rem; diff --git a/source/src/pages/Page/Toc.tsx b/source/src/pages/Page/Toc.tsx index 2580652..5c2bca5 100644 --- a/source/src/pages/Page/Toc.tsx +++ b/source/src/pages/Page/Toc.tsx @@ -45,16 +45,16 @@ const Toc = (props: { fetchedPage: FetchedPage }) => { setIsTocOpened((prev) => !prev) }} > - Table of Content - {isTocOpened ? ( - - ) : ( - - )} + + Table of Contents{" "} + + -
{props.fetchedPage.toc}
+
{props.fetchedPage.toc}

diff --git a/source/src/pages/Page/index.tsx b/source/src/pages/Page/index.tsx index d4983f8..18eb9a2 100644 --- a/source/src/pages/Page/index.tsx +++ b/source/src/pages/Page/index.tsx @@ -199,7 +199,6 @@ const Page = () => { {/* page content */}