Closed
Bug 1569816
Opened 6 years ago
Closed 6 years ago
Could we accomplish what highlightSections does without JavaScript?
Categories
(developer.mozilla.org Graveyard :: General, enhancement, P1)
developer.mozilla.org Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: espressive, Assigned: espressive)
References
Details
(Keywords: in-triage, Whiteboard: [points=1])
Attachments
(2 files)
Currently, we have a piece of JavaScript(see below) that is responsible for some DOM manipulation in order to get the h3 and h5 elements inside the main content area to display correctly i.e. the black background
It seems like we can accomplish this with CSS only. This bug is to explore that possibility, and implement it if possible.
// This is an effect function that runs every time the article is rendered.
// This is the React version of the code in kuma/static/js/highlight.js
// which is used on the wiki domain
function highlightSections(article) {
let sections = article.querySelectorAll('#wikiArticle h3, #wikiArticle h5');
for (let section of sections) {
section.classList.add('highlight-spanned');
section.innerHTML = `<span class="highlight-span">${
section.innerHTML
}</span>`;
}
}
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Commit merged into master by Peter Bengtsson (peterbe)
Authored by Schalk Neethling (schalkneethling)
Assignee | ||
Updated•6 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•