Skip to content

Commit

Permalink
fix: fixes callout metadata surfacing not applying to default types
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Mar 22, 2022
1 parent 9987e0f commit 25b7756
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/callout/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ export default class CalloutManager extends Component {
calloutProcessor(el: HTMLElement, ctx: MarkdownPostProcessorContext) {
const callout = el?.querySelector<HTMLDivElement>(".callout");
if (!callout) return;

const type = callout.dataset.callout;
const admonition = this.plugin.data.userAdmonitions[type];
if (!admonition) return;

//apply metadata
const section = ctx.getSectionInfo(el);
if (section) {
Expand All @@ -66,6 +61,10 @@ export default class CalloutManager extends Component {
}
}

const type = callout.dataset.callout;
const admonition = this.plugin.data.userAdmonitions[type];
if (!admonition) return;

const titleEl = callout.querySelector<HTMLDivElement>(".callout-title");
const content =
callout.querySelector<HTMLDivElement>(".callout-content");
Expand Down

0 comments on commit 25b7756

Please sign in to comment.