From 80a9073870c915a305c04b095956dd9bcd037807 Mon Sep 17 00:00:00 2001 From: circle33 Date: Sat, 11 Nov 2023 12:34:06 +0800 Subject: [PATCH 1/3] fix: sometimes skips words --- src/TTSServiceImplementation.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/TTSServiceImplementation.ts b/src/TTSServiceImplementation.ts index 07612c1..19e0dea 100644 --- a/src/TTSServiceImplementation.ts +++ b/src/TTSServiceImplementation.ts @@ -43,9 +43,6 @@ export class TTSServiceImplementation implements TTSService { content = content.replace(/\*/g, ""); content = content.replace(/\^/g, ""); content = content.replace(/==/g, ""); - - //block references - content = content.replace(/^\S{6}/g, ""); } if (!this.plugin.settings.speakLinks) { //regex from https://stackoverflow.com/a/37462442/5589264 From 5539f3560b9fb21b2cff95213948830d9f5e39ab Mon Sep 17 00:00:00 2001 From: circle33 Date: Sat, 9 Dec 2023 19:40:51 +0800 Subject: [PATCH 2/3] fix: sometimes skips words --- src/TTSServiceImplementation.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TTSServiceImplementation.ts b/src/TTSServiceImplementation.ts index 19e0dea..0667575 100644 --- a/src/TTSServiceImplementation.ts +++ b/src/TTSServiceImplementation.ts @@ -43,6 +43,9 @@ export class TTSServiceImplementation implements TTSService { content = content.replace(/\*/g, ""); content = content.replace(/\^/g, ""); content = content.replace(/==/g, ""); + + //block references + content = content.replace(/\^\S*/g, ""); } if (!this.plugin.settings.speakLinks) { //regex from https://stackoverflow.com/a/37462442/5589264 From d85e2ac45991db4f5c5870b0aa04b91ac05d24c3 Mon Sep 17 00:00:00 2001 From: joethei Date: Fri, 16 Feb 2024 11:37:59 +0100 Subject: [PATCH 3/3] Update settings object if settings file is changed. --- src/TTSServiceImplementation.ts | 3 +-- src/main.ts | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TTSServiceImplementation.ts b/src/TTSServiceImplementation.ts index e31f4ac..beb5108 100644 --- a/src/TTSServiceImplementation.ts +++ b/src/TTSServiceImplementation.ts @@ -1,4 +1,4 @@ -import {MarkdownView, Notice, parseYaml, setIcon, TFile} from "obsidian"; +import {MarkdownView, Notice, parseYaml} from "obsidian"; import {LanguageVoiceMap} from "./settings"; import TTSPlugin from "./main"; import {detect} from "tinyld"; @@ -138,7 +138,6 @@ export class TTSServiceImplementation implements TTSService { } getLanguageFromFrontmatter(view: MarkdownView): string { - view. let language = ""; //check if any language is defined in frontmatter if (!view.getViewData().startsWith("---")) return language; diff --git a/src/main.ts b/src/main.ts index 0017aeb..2e3161b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -227,4 +227,8 @@ export default class TTSPlugin extends Plugin { async saveSettings(): Promise { await this.saveData(this.settings); } + + async onExternalSettingsChange() { + await this.loadSettings(); + } }