Skip to content

Commit

Permalink
6.2.8
Browse files Browse the repository at this point in the history
- Non-codeblock processor now only runs for <p> elements (close javalent#79)
  • Loading branch information
valentine195 committed Aug 20, 2021
1 parent 3fc08d6 commit e064e10
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-admonition",
"name": "Admonition",
"version": "6.2.7",
"version": "6.2.8",
"minAppVersion": "0.11.0",
"description": "Admonition block-styled content for Obsidian.md",
"author": "Jeremy Valentine",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-admonition",
"version": "6.2.7",
"version": "6.2.8",
"description": "Admonition block-styled content for Obsidian.md",
"main": "main.js",
"scripts": {
Expand Down
10 changes: 9 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ export default class ObsidianAdmonition

this.registerMarkdownPostProcessor(async (el, ctx) => {
if (!this.data.enableMarkdownProcessor) return;

if (END_REGEX.test(el.textContent) && push) {
push = false;
const lastElement = createDiv();
Expand All @@ -420,7 +421,14 @@ export default class ObsidianAdmonition
}

if (!TYPE_REGEX.test(el.textContent) && !push) return;

if (
!(
Array.from(el.children).find((e) =>
TYPE_REGEX.test(e.textContent)
) instanceof HTMLParagraphElement
)
)
return;
if (!push) {
push = true;
let child = new MarkdownRenderChild(el);
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"4.3.1": "0.12.0",
"4.4.2": "0.12.2",
"5.0.3": "0.12.2",
"6.2.7": "0.12.4"
"6.2.8": "0.12.4"
}

0 comments on commit e064e10

Please sign in to comment.