Skip to content

Commit

Permalink
remove console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpbray committed Aug 6, 2024
1 parent c24d171 commit ae3e6ef
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions _extensions/closeread/closeread.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,33 +204,27 @@ function highlightSpans(focusedSticky, triggerEl) {

// dim enclosing block
focusedSticky.classList.add("cr-hl-within");
console.log("focusedSticky:", focusedStickyName)

// add highlight class to appropriate spans
console.log(">> highlightIds", highlightIds)
highlightIds.split(',').forEach(highlightId => {
const trimmedId = highlightId.trim();
let spanSelector = "";

// determine the appropriate spanSelector
// determine the right spanSelector
// for line numbers
if (!isNaN(trimmedId)) {

console.log("trying to highlight a number")
// that are in line blocks
if (focusedSticky.querySelector('.line-block') !== null) {
console.log("on a line block")
spanSelector = `span[id^="lb"][id*="-${trimmedId}"]`;
console.log("with this selector:", spanSelector)
}
// or in code cells
if (focusedSticky.querySelector('.cell') !== null) {
console.log("on a code cell")
spanSelector = `span[id^="cb"][id*="-${trimmedId}"]`;
}

// and for span ids
} else {
console.log("trying to highlight a span")
spanSelector = `span[id="${trimmedId}"]`;
}

Expand Down

0 comments on commit ae3e6ef

Please sign in to comment.