feat(highlights): ignore footnotes

This commit is contained in:
Elian Doran 2025-01-07 12:38:50 +02:00
parent 85c225fe05
commit 1dcc839bab
No known key found for this signature in database

View File

@ -247,6 +247,13 @@ export default class HighlightsListWidget extends RightPanelWidget {
const subHtml = match[0];
const startIndex = match.index;
const endIndex = combinedRegex.lastIndex;
// Ignore footnotes.
if (subHtml.startsWith('<strong><a href="#fnref')) {
continue;
}
console.log(subHtml);
if (prevEndIndex !== -1 && startIndex === prevEndIndex) {
// If the previous element is connected to this element in HTML, then concatenate them into one.
$highlightsList.children().last().append(subHtml);