Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove reference-link #819

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions __tests__/__snapshots__/index.test.js.snap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what all this dark red means here, but it looks like these tests are giving the correct output so 🤷…

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