You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MutationObserver article uses non-existent Prism.highlightElem instead of Prism.highlightElement #3979
The prose and inline code examples in the "Usage for architecture" section refer to Prism.highlightElem (6 occurrences), but this method does not exist in the Prism.js API. The correct name is Prism.highlightElement, which the demo code later in the same article already uses:
// inline example (incorrect)document.querySelectorAll('pre[class*="language"]').forEach(Prism.highlightElem);// demo code in the same article (correct)Prism.highlightElement(node);
Readers who copy the inline examples get a TypeError, and the inconsistency within one article is confusing (this was noticed during a review of the Korean translation: javascript-tutorial/ko.javascript.info#1900).
A related nit in the same lines: passing the method reference directly to forEach forwards (element, index, array) into the highlightElement(element, async, callback) signature, so the index ends up as the async argument. Wrapping it in an arrow function that passes only the element avoids that.
Activity