Skip to content

Commit 005286a

Browse files
authored
Merge pull request #2 from valentine195:valentine195/issue1
- Processor no longer parses inside code blocks
2 parents 134a1eb + 18875ae commit 005286a

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "markdown-attributes",
33
"name": "Markdown Attributes",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"minAppVersion": "0.12.10",
66
"description": "Add markdown attributes to elements in Obsidian.md",
77
"author": "Jeremy Valentine",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markdown-attributes",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Add markdown attributes to elements in Obsidian.md",
55
"main": "main.js",
66
"scripts": {

src/processor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ export default class Processor {
168168
}
169169

170170
// Recursively find all attributes from the children of this element.
171+
171172
for (let child of Array.from(el.children)) {
172173
if (!(child instanceof HTMLElement)) continue;
174+
if (child instanceof HTMLPreElement || child.tagName.toLowerCase() === "code")
175+
continue;
173176
elements.push(...this.recurseAndParseElements(child));
174177
}
175178

versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"0.0.7": "0.12.0",
3-
"1.0.0": "0.12.0"
3+
"1.0.1": "0.12.0"
44
}

0 commit comments

Comments
 (0)