Skip to content

Commit

Permalink
Fix Tutorial search scrolling (#140)
Browse files Browse the repository at this point in the history
* replacing parantheses and exclamations

* remove all punctuation

* add apostrophe
  • Loading branch information
TuanaCelik committed Jun 2, 2023
1 parent 70ef00c commit ffea4bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion themes/haystack/layouts/_default/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h2>{{ .Params.contribute.title }}</h2>
const card = document.createElement("a");
card.classList.add("search-modal-card");
const headline = doc.meta.headlines[0]?.headline;
card.href = `/tutorials/${doc.meta.file_name.toLowerCase().replace(".txt", "")}${headline ? `#${headline.toLowerCase().trim().replace(/ /g, "-")}` : "" }`;
card.href = `/tutorials/${doc.meta.file_name.toLowerCase().replace(".txt", "")}${headline ? `#${headline.toLowerCase().trim().replace(/ /g, "-").replace(/[.,'\/!$%\^&\*;:{}=()]/g, "")}` : "" }`;
card.innerHTML = `
<svg
width="32"
Expand Down

1 comment on commit ffea4bc

@vercel
Copy link

@vercel vercel bot commented on ffea4bc Jun 2, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.