From faebb0e152dd057f9b535fe5a00b2890694df4e9 Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Mon, 16 Oct 2023 20:17:12 +0200 Subject: [PATCH] Fix #22 - missing callout icon --- src/note.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/note.ts b/src/note.ts index 63c65b4..2339511 100644 --- a/src/note.ts +++ b/src/note.ts @@ -119,14 +119,15 @@ export default class Note { // Get the callout icon from the CSS. I couldn't find any way to do this from the DOM, // as the elements may be far down below the fold and are not populated. const type = el.getAttribute('data-callout') - const icon = this.getCalloutIcon(selectorText => selectorText.includes(`data-callout="${type}"`)) || defaultCalloutType + let icon = this.getCalloutIcon(selectorText => selectorText.includes(`data-callout="${type}"`)) || defaultCalloutType + icon = icon.replace('lucide-', '') // Replace the existing icon so we: // a) don't get double-ups, and // b) have a consistent style const iconEl = el.querySelector('div.callout-icon') const svgEl = iconEl?.querySelector('svg') if (svgEl) { - svgEl.outerHTML = `` + svgEl.outerHTML = `` } }