From 18875aef7f58d8fb23f22a1a19a54caaaafc5181 Mon Sep 17 00:00:00 2001 From: valentine195 Date: Sun, 15 Aug 2021 09:35:46 -0400 Subject: [PATCH] - Processor no longer parses inside code blocks Fixes #1 --- manifest.json | 2 +- package.json | 2 +- src/processor.ts | 3 +++ versions.json | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index a34955e..fb53074 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "markdown-attributes", "name": "Markdown Attributes", - "version": "1.0.0", + "version": "1.0.1", "minAppVersion": "0.12.10", "description": "Add markdown attributes to elements in Obsidian.md", "author": "Jeremy Valentine", diff --git a/package.json b/package.json index 86326d9..e19c9b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-attributes", - "version": "1.0.0", + "version": "1.0.1", "description": "Add markdown attributes to elements in Obsidian.md", "main": "main.js", "scripts": { diff --git a/src/processor.ts b/src/processor.ts index 9642cb7..7220b25 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -168,8 +168,11 @@ export default class Processor { } // Recursively find all attributes from the children of this element. + for (let child of Array.from(el.children)) { if (!(child instanceof HTMLElement)) continue; + if (child instanceof HTMLPreElement || child.tagName.toLowerCase() === "code") + continue; elements.push(...this.recurseAndParseElements(child)); } diff --git a/versions.json b/versions.json index 74999dd..727dd01 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "0.0.7": "0.12.0", - "1.0.0": "0.12.0" + "1.0.1": "0.12.0" } \ No newline at end of file