Skip to content

Commit

Permalink
~ allow for starting playback from preview mode.
Browse files Browse the repository at this point in the history
~ fix errors that show up on android(even as the plugin will be disabled)
  • Loading branch information
joethei committed Dec 26, 2021
1 parent 6e3301b commit 99e619d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-tts",
"name": "Text to Speech",
"version": "0.3.5",
"version": "0.4.0",
"minAppVersion": "0.12.0",
"description": "Text to speech for Obsidian. Hear your notes.",
"author": "Johannes Theiner",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-tts",
"version": "0.3.5",
"version": "0.4.0",
"description": "Text to speech for Obsidian. Hear your notes.",
"main": "main.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/TTSService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class 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
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class TTSPlugin extends Plugin {
//https://bugs.chromium.org/p/chromium/issues/detail?id=487255
if (Platform.isAndroidApp) {
new Notice("TTS: due to a bug in android this plugin does not work on this platform");
throw Error("TTS: due to a bug in android this plugin does not work on this platform");
this.unload();
}

await this.loadSettings();
Expand All @@ -31,7 +31,7 @@ export default class TTSPlugin extends Plugin {
const markdownView = this.app.workspace.getActiveViewOfType(MarkdownView);
if(!checking && markdownView)
this.ttsService.play(markdownView);
return markdownView ? true : false;
return !!markdownView;
}
});

Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"0.3.2": "0.12.0",
"0.3.3": "0.12.0",
"0.3.4": "0.12.0",
"0.3.5": "0.12.0"
"0.3.5": "0.12.0",
"0.4.0": "0.12.0"
}

0 comments on commit 99e619d

Please sign in to comment.