Skip to content

Commit

Permalink
fix: remove strange new worlds links
Browse files Browse the repository at this point in the history
Close #26
  • Loading branch information
mvdkwast committed Apr 16, 2023
1 parent 41d0959 commit 4de36f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ class DocumentRenderer {
this.makeCheckboxesReadOnly(node);
this.removeCollapseIndicators(node);
this.removeButtons(node);
this.removeStrangeNewWorldsLinks(node);

if (this.options.formatAsTables) {
this.transformCodeToTables(node);
Expand Down Expand Up @@ -564,6 +565,12 @@ class DocumentRenderer {
.forEach(node => node.remove());
}

/** Remove counters added by Strange New Worlds plugin (https://github.com/TfTHacker/obsidian42-strange-new-worlds) */
private removeStrangeNewWorldsLinks(node: HTMLElement) {
node.querySelectorAll('.snw-reference')
.forEach(node => node.remove());
}

/** Transform code blocks to tables */
private transformCodeToTables(node: HTMLElement) {
node.querySelectorAll('pre')
Expand Down

0 comments on commit 4de36f5

Please sign in to comment.