summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/code_navigation/utils/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/code_navigation/utils/index.js')
-rw-r--r--app/assets/javascripts/code_navigation/utils/index.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/assets/javascripts/code_navigation/utils/index.js b/app/assets/javascripts/code_navigation/utils/index.js
index 46038df2f86..7a5fa9f4a35 100644
--- a/app/assets/javascripts/code_navigation/utils/index.js
+++ b/app/assets/javascripts/code_navigation/utils/index.js
@@ -17,11 +17,9 @@ export const addInteractionClass = ({ path, d, wrapTextNodes }) => {
if (wrapTextNodes) {
line.childNodes.forEach((elm) => {
- if (isTextNode(elm)) {
- // Highlight.js does not wrap all text nodes by default
- // We need all text nodes to be wrapped in order to append code nav attributes
- elm.replaceWith(...wrapNodes(elm.textContent));
- }
+ // Highlight.js does not wrap all text nodes by default
+ // We need all text nodes to be wrapped in order to append code nav attributes
+ elm.replaceWith(...wrapNodes(elm.textContent, elm.classList));
});
}