diff --git a/src/main.ts b/src/main.ts index c3daea3..01bd6fc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -230,6 +230,9 @@ export default class JustSharePleasePlugin extends Plugin { if (this.settings.stripFrontmatter) text = text.replace(/^---\s*\n.*?\n---\s*\n(.*)$/s, "$1"); + // strip comments + text = text.replace(/%%.*?%%/sg, ""); + // include note name if (this.settings.includeNoteName) text = `# ${file.basename}\n\n${text}`; diff --git a/test-vault/.obsidian/plugins/just-share-please/data.json b/test-vault/.obsidian/plugins/just-share-please/data.json index e465581..233c475 100644 --- a/test-vault/.obsidian/plugins/just-share-please/data.json +++ b/test-vault/.obsidian/plugins/just-share-please/data.json @@ -2,18 +2,13 @@ "url": "http://localhost:8080", "shared": [ { - "id": "234df7b7", - "password": "0ef1504bfe83cd9ca812434caa7aacf4", + "id": "22478da6", + "password": "5553101a4b7cb2b47dab2bb15ba6cd51", "path": "Cool Test Note.md" - }, - { - "id": "014b266c", - "password": "1c9459d7cdac804f72272c8f6d4a9abc", - "path": "dir/Cool Test Note.md" } ], "stripFrontmatter": true, "includeNoteName": true, "unshareDeletedFiles": false, "autoUpdateShares": false -} \ No newline at end of file +} diff --git a/test-vault/Cool Test Note.md b/test-vault/Cool Test Note.md index 01799a5..f998c79 100644 --- a/test-vault/Cool Test Note.md +++ b/test-vault/Cool Test Note.md @@ -2,7 +2,11 @@ test: yes --- -This is a cool test note, my friends! +This is a cool test note%%with an inline comment%%, my friends! + +%% +BLOCK COMMENT +%% > How are you? @@ -24,6 +28,13 @@ $.ajax({ cool!! +%% +ANOTHER BLOCK COMMENT +you know + +WITH A LOT OF TEXT +%% + blah blah i added and removed this The following is $x^2 = 7$, but more complicated!