Skip to content

Commit

Permalink
Merge pull request #1316 from NatLibFi/issue1270-hierarchy-syntax-error
Browse files Browse the repository at this point in the history
Use explicit $.parseHTML() to avoid JS syntax error
  • Loading branch information
osma authored Apr 28, 2022
2 parents 502830f + 8782ebb commit 964b68f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resource/js/hierarchy.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function nodeLabelSortKey(node) {

// parse the HTML code in node.text and return just the label as a lower case value for sorting
// should look like '<span class="tree-notation">12.3</span> <span class="tree-label">Hello</span>'
var label = $(node.text.toLowerCase()).filter('.tree-label').text();
var label = $($.parseHTML(node.text.toLowerCase())).filter('.tree-label').text();

return domain + " " + label;
}
Expand Down

0 comments on commit 964b68f

Please sign in to comment.