From 54f5ac7b8de57a8c55c08d92f3d308882aff8efa Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 6 Sep 2016 08:04:38 -0700 Subject: [PATCH] Simplify nested highlights selector. --- lib/main/build-site.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/main/build-site.js b/lib/main/build-site.js index a3e683b66..6056289be 100644 --- a/lib/main/build-site.js +++ b/lib/main/build-site.js @@ -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.