Skip to content

Commit 4134132

Browse files
committed
- remove .outerHtml
1 parent 6a57894 commit 4134132

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/WikipediaNote.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ async function fetchWikipediaMarkdown(title: string, settings: WikiPluginSetting
138138
filter: "span",
139139
replacement: (content, node) => {
140140
if (node) {
141-
if ((node as HTMLElement)?.getAttribute("class") == ("figure")) {
142-
const el = node as HTMLElement;
143-
return `${el.outerHTML}`;
141+
if ((node as HTMLElement)?.classList.contains("figure")) {
142+
const serializer = new XMLSerializer();
143+
return serializer.serializeToString(node);
144144
} else {
145-
return content;
146145
}
147146
}
148147
return "";

0 commit comments

Comments
 (0)