Skip to content

Commit

Permalink
feature: removed unnecessary clutter when rendering slide in node pre…
Browse files Browse the repository at this point in the history
…view
  • Loading branch information
MSzturc committed May 16, 2022
1 parent e7f4c48 commit 714f13c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ export default class AdvancedSlidesPlugin extends Plugin {

this.registerEditorSuggest(new LineSelectionListener(this.app, this));

this.registerMarkdownPostProcessor((element, context) => {
const paragraphs = element.querySelectorAll<HTMLParagraphElement>("p");
for (let index = 0; index < paragraphs.length; index++) {
const paragraph = paragraphs.item(index);

if (paragraph.innerText.startsWith(":::")) {
paragraph.remove();
}
}
});

addIcon('slides', ICON_DATA);
addIcon('refresh', REFRESH_ICON);

Expand Down

0 comments on commit 714f13c

Please sign in to comment.