Skip to content

Commit

Permalink
chore: remove reference-link
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcuva committed Oct 9, 2023
1 parent 8b9e895 commit 87600d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions __tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`anchors 1`] = `
"<p><a href=\\"http://example.com\\" target=\\"\\" title=\\"\\">link</a><br>
<a href=\\"\\" target=\\"\\" title=\\"\\">xss</a><br>
<a href=\\"/docs/slug\\" target=\\"\\" title=\\"\\" class=\\"doc-link\\" data-sidebar=\\"slug\\">doc</a><br>
<a href=\\"/reference-link/slug\\" target=\\"\\" title=\\"\\">ref</a><br>
<a href=\\"/reference/slug\\" target=\\"\\" title=\\"\\">ref</a><br>
<a href=\\"/changelog/slug\\" target=\\"\\" title=\\"\\">blog</a><br>
<a href=\\"/changelog/slug\\" target=\\"\\" title=\\"\\">changelog</a><br>
<a href=\\"/page/slug\\" target=\\"\\" title=\\"\\">page</a></p>"
Expand All @@ -24,7 +24,7 @@ exports[`anchors with baseUrl 1`] = `
&lt;a href=\\"page:slug\\"&gt;page&lt;/a&gt;&lt;/p&gt;"
`;
exports[`anchors with baseUrl and special characters in url hash 1`] = `"<p><a href=\\"/reference-link/slug#%E6%95%B4\\" target=\\"\\" title=\\"\\">ref</a></p>"`;
exports[`anchors with baseUrl and special characters in url hash 1`] = `"<p><a href=\\"/reference/slug#%E6%95%B4\\" target=\\"\\" title=\\"\\">ref</a></p>"`;
exports[`check list items 1`] = `
"<ul class=\\"contains-task-list\\">
Expand Down
2 changes: 1 addition & 1 deletion components/Anchor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function getHref(href, baseUrl) {

const ref = path.match(/^ref:([-_a-zA-Z0-9#]*)$/);
if (ref) {
return `${base}/reference-link/${ref[1]}${hashStr}`;
return `${base}/reference/${ref[1]}${hashStr}`;
}

// we need to perform two matches for changelogs in case
Expand Down

0 comments on commit 87600d5

Please sign in to comment.