Skip to content

Исправить имя метода Prism API: highlightElem → highlightElement - #2185

Open
1t1sCooL wants to merge 1 commit into
javascript-tutorial:masterfrom
1t1sCooL:fix-prism-highlight-element
Open

Исправить имя метода Prism API: highlightElem → highlightElement#2185
1t1sCooL wants to merge 1 commit into
javascript-tutorial:masterfrom
1t1sCooL:fix-prism-highlight-element

Conversation

@1t1sCooL

@1t1sCooL 1t1sCooL commented Aug 6, 2026

Copy link
Copy Markdown

В статье про MutationObserver текст и первые примеры кода используют несуществующий метод Prism.highlightElem, тогда как правильное имя в API Prism.js — Prism.highlightElement (именно его уже используют финальные примеры кода в конце этой же статьи, строки с observer).

Исправлены 5 упоминаний в тексте и 2 примера кода. Вызовы forEach(Prism.highlightElem) заменены на forEach(elem => Prism.highlightElement(elem)), поскольку второй аргумент forEach (индекс) попал бы в параметр async метода highlightElement.

Это перенос апстрим-фикса из английской версии: javascript-tutorial/en.javascript.info#3980 (коммит f7922ed).

@javascript-translate-bot javascript-translate-bot added the review needed Review needed, please approve or request changes label Aug 6, 2026
@javascript-translate-bot
javascript-translate-bot requested a review from a team August 6, 2026 14:39
@CLAassistant

CLAassistant commented Aug 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@1t1sCooL

Copy link
Copy Markdown
Author

recheck

@1t1sCooL 1t1sCooL closed this Aug 25, 2026
@1t1sCooL 1t1sCooL reopened this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review needed Review needed, please approve or request changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants