fix: use cached headingText variable for consistency
Reuse the previously cached headingText variable instead of accessing element.innerText again to avoid unnecessary DOM access.
This commit is contained in:
@@ -29,7 +29,7 @@ export const getHeadingsfromTheArticle = () => {
|
||||
|
||||
rows.push({
|
||||
slug,
|
||||
title: element.innerText,
|
||||
title: headingText,
|
||||
tag: element.tagName.toLowerCase(),
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user