remove slash before anchor link
This commit is contained in:
parent
dd51bd0a2f
commit
12eb361d69
1 changed files with 2 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ const TableOfContents: FunctionalComponent<{ headings: MarkdownHeading[]; curren
|
||||||
headings = [],
|
headings = [],
|
||||||
currentPage,
|
currentPage,
|
||||||
}) => {
|
}) => {
|
||||||
|
// remove slash before #
|
||||||
|
currentPage = currentPage.endsWith('/') ? currentPage.slice(0, -1) : currentPage;
|
||||||
const toc = useRef<any>();
|
const toc = useRef<any>();
|
||||||
const onThisPageID = 'on-this-page-heading';
|
const onThisPageID = 'on-this-page-heading';
|
||||||
const itemOffsets = useRef<ItemOffsets[]>([]);
|
const itemOffsets = useRef<ItemOffsets[]>([]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue