Simplify nested highlights selector.

This commit is contained in:
John-David Dalton
2016-09-06 08:04:38 -07:00
parent 5c688cc0b7
commit 54f5ac7b8d

View File

@@ -137,9 +137,9 @@ function tidyHighlights($) {
});
// Collapse nested highlights.
_.each(['comment', 'string'], cls => {
$parent.find(`[class~="${ cls }"] > [class~="${ cls }"]`).each(function() {
const $parent = $(this).parent();
$parent.text($parent.text());
$parent.find(`[class~="${ cls }"]`).each(function() {
const $element = $(this);
$element.text($element.text());
});
});
// Collapse nested spans.