Forráskód Böngészése

:bug: https://github.com/siyuan-note/siyuan/issues/5066 addIcons

Vanessa 2 éve
szülő
commit
b24224f7c4
2 módosított fájl, 2 hozzáadás és 2 törlés
  1. 1 1
      app/src/plugin/index.ts
  2. 1 1
      app/src/util/assets.ts

+ 1 - 1
app/src/plugin/index.ts

@@ -61,7 +61,7 @@ export class Plugin {
     }
 
     public addIcons(svg: string) {
-        document.body.insertAdjacentHTML("afterbegin", `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
+        document.body.insertAdjacentHTML("afterbegin", `<svg data-name="${this.name}" style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
 <defs>${svg}</defs></svg>`);
     }
 

+ 1 - 1
app/src/util/assets.ts

@@ -105,7 +105,7 @@ export const loadAssets = (data: IAppearance) => {
         while (svgElement.tagName === "svg") {
             const currentSvgElement = svgElement;
             svgElement = svgElement.nextElementSibling;
-            if (currentSvgElement.id !== "emojiScriptSvg") {
+            if (currentSvgElement.id !== "emojiScriptSvg" && !currentSvgElement.getAttribute("data-name")) {
                 currentSvgElement.remove();
             }
         }