Skip to content

Commit

Permalink
Fix bug with escaping slash for LaTeX mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Colucci committed Dec 15, 2020
1 parent 8a201f7 commit 7ccee97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "flashcards-obsidian",
"name": "Flashcards",
"version": "1.0.3",
"version": "1.0.4",
"minAppVersion": "0.9.17",
"description": "Anki integration",
"author": "Alex Colucci",
Expand Down
6 changes: 3 additions & 3 deletions src/services/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class Parser {
}

private parseLine(str: string, vaultName: string) {
return this.mathToAnki(this.htmlConverter.makeHtml(this.substituteObsidianLinks(this.substituteImageLinks(str), vaultName)))
return this.htmlConverter.makeHtml(this.mathToAnki(this.substituteObsidianLinks(this.substituteImageLinks(str), vaultName)))
}

private getImageLinks(str: string) {
Expand Down Expand Up @@ -252,10 +252,10 @@ export class Parser {

private mathToAnki(str: string) {
let mathBlockRegex = /(\$\$)(.*?)(\$\$)/gi
str = str.replace(mathBlockRegex, '\\($2\\)')
str = str.replace(mathBlockRegex, '\\\\($2\\\\)')

let mathInlineRegex = /(\$)(.*?)(\$)/gi
str = str.replace(mathInlineRegex, '\\($2\\)')
str = str.replace(mathInlineRegex, '\\\\($2\\\\)')

return str
}
Expand Down

0 comments on commit 7ccee97

Please sign in to comment.