Skip to content

Commit 3da5f8b

Browse files
committed
fix markdown rendering
1 parent f48b87a commit 3da5f8b

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

exampleVault/Buttons/Templater Buttons.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,17 @@ action:
1010
type: "replaceSelf"
1111
replacement: "templates/templater/Templater Template.md"
1212
templater: true
13+
```
14+
15+
```meta-bind-button
16+
label: This is a button
17+
hidden: false
18+
class: ""
19+
tooltip: "test"
20+
id: "test"
21+
style: default
22+
actions:
23+
- type: replaceSelf
24+
replacement: "test"
25+
templater: false
1326
```

packages/core/src/fields/excluded/ExcludedBase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export class ExcludedBase extends FieldBase {
1010
protected onMount(targetEl: HTMLElement): void {
1111
console.log('meta-bind | ExcludedBase >> mount');
1212

13+
DomHelpers.empty(targetEl);
14+
1315
DomHelpers.createElement(targetEl, 'span', {
1416
text: '[META_BIND] This folder has been excluded in the settings',
1517
class: 'mb-error',

packages/obsidian/src/ObsidianInternalAPI.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export class ObsidianInternalAPI extends InternalAPI<MetaBindPlugin> {
5151

5252
public async renderMarkdown(markdown: string, element: HTMLElement, filePath: string): Promise<() => void> {
5353
const component = new Component();
54+
component.load();
5455
await MarkdownRenderer.render(this.app, markdown, element, filePath, component);
5556
return () => component.unload();
5657
}

packages/obsidian/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ export default class MetaBindPlugin extends Plugin implements IPlugin {
181181
continue;
182182
}
183183

184-
console.log(ctx.getSectionInfo(codeBlock));
185-
186184
// console.log(content, ctx.getSectionInfo(codeBlock)?.lineStart, ctx.getSectionInfo(codeBlock)?.lineEnd);
187185
const base = this.api.createInlineFieldOfTypeFromString(fieldType, content, filePath, undefined);
188186
this.api.wrapInMDRC(base, codeBlock, ctx);

0 commit comments

Comments
 (0)