✨ Simplify arrow function syntax and remove unnecessary whitespace in highlight directive
This commit is contained in:
@@ -37,8 +37,8 @@ function applyHighlight(el, theme = 'github-dark') {
|
|||||||
*/
|
*/
|
||||||
function createHighlightObserver(el, theme) {
|
function createHighlightObserver(el, theme) {
|
||||||
const observer = new IntersectionObserver(
|
const observer = new IntersectionObserver(
|
||||||
(entries) => {
|
entries => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach(entry => {
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
applyHighlight(entry.target, theme);
|
applyHighlight(entry.target, theme);
|
||||||
observer.disconnect();
|
observer.disconnect();
|
||||||
|
|||||||
Reference in New Issue
Block a user