Skip to content

Commit

Permalink
fix: 1.#19
Browse files Browse the repository at this point in the history
  • Loading branch information
JuckZ committed Apr 18, 2023
1 parent 302c025 commit cf6a7e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ export default class AwesomeBrainManagerPlugin extends Plugin {
NotifyUtil.init(this);
this.setupUI();
this.setupCommands();
MarkdownPreviewRenderer.registerPostProcessor(this.process.EmojiProcess);
if (SETTINGS.enableTwemoji.value) {
MarkdownPreviewRenderer.registerPostProcessor(this.process.EmojiProcess);
}
this.registerMarkdownPostProcessor(codeEmoji);
this.registerMarkdownCodeBlockProcessor('plantuml', this.process.UMLProcess);
this.registerMarkdownCodeBlockProcessor('vue', this.process.VueProcess);
Expand Down
11 changes: 10 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Settings {
ntfyServerHost: SettingModel<string, string>;
ntfyToken: SettingModel<string, string>;
version: SettingModel<string, string>;
enableTwemoji: SettingModel<boolean, boolean>;

constructor() {
this.cursorEffectBuilder = this.settings
Expand Down Expand Up @@ -120,6 +121,14 @@ class Settings {
.toggle(false)
.build(new RawSerde());

this.enableTwemoji = this.settings
.newSettingBuilder()
.key('enableTwemoji')
.name(t.setting.enableTwemoji.name)
.desc(t.setting.enableTwemoji.desc)
.toggle(false)
.build(new RawSerde());

this.debugEnable = this.settings
.newSettingBuilder()
.key('debugEnable')
Expand Down Expand Up @@ -187,7 +196,7 @@ class Settings {

this.settings.newGroup(t.setting.title.pomodoro).addSettings(this.expectedTime);

this.settings.newGroup(t.setting.title.toolbar).addSettings(this.toolbar);
this.settings.newGroup(t.setting.title.tools).addSettings(this.toolbar, this.enableTwemoji);

this.settings
.newGroup('Notification')
Expand Down

0 comments on commit cf6a7e2

Please sign in to comment.