Skip to content

Instantly share code, notes, and snippets.

@kadimi
Created September 15, 2025 14:06
Show Gist options
  • Select an option

  • Save kadimi/1b1b8480e4a3026d9cb6a180be273414 to your computer and use it in GitHub Desktop.

Select an option

Save kadimi/1b1b8480e4a3026d9cb6a180be273414 to your computer and use it in GitHub Desktop.
Bookmarklet for Khan Academy to fix question selection and transtlation
javascript: (function () {
const firstRenderer = document.querySelector("div.perseus-renderer");
if (firstRenderer) {
const paragraphs = firstRenderer.querySelectorAll(
":scope > div.paragraph[data-perseus-paragraph-index]",
);
const paragraphsExceptLast = Array.from(paragraphs).slice(0, -1);
paragraphsExceptLast.forEach((p) => {
if (p.querySelector("span.mathjax-wrapper")) {
p.textContent = p.textContent.replace(/____/g, "[N]");
}
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment