Skip to content

Commit d382f8c

Browse files
author
Chris Swenson
authored
Merge pull request #73 from malloydata/crs-fix-links
Fix issues with links
2 parents 5c9f348 + fb9ad97 commit d382f8c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/render_document.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class Renderer {
325325
return text;
326326
}
327327
this.links.push({ link: href, style: "md", position });
328-
href = href.replace(/\.malloynb$/, "");
328+
href = href.replace(/\.malloynb$/, "").replace(/\.malloynb#/, "#");
329329
let out = href.startsWith("/")
330330
? `<a href="${DEFAULT_CONTEXT.site.baseurl}${href}"`
331331
: `<a href="${href}"`;

src/js/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ for (const result of results) {
179179
linkElement.innerHTML = title;
180180
linkElement.href =
181181
result.segment.path
182-
.replace(".malloynb", ".html") + (index > 0 ? "#" + anchor : "");
182+
.replace(".malloynb", "") + (index > 0 ? "#" + anchor : "");
183183
highlight(linkElement, query);
184184
headingElement.appendChild(linkElement);
185185
if (index != result.segment.titles.length - 1) {

0 commit comments

Comments
 (0)