Merge pull request #45 from ivan-lednev/enable-block-math

Parse $$ blocks to block math in anki cards
This commit is contained in:
Alex Colucci 2021-06-23 20:50:10 +02:00 committed by GitHub
commit 4e80d75225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -258,7 +258,7 @@ export class Parser {
private mathToAnki(str: string) {
let mathBlockRegex = /(\$\$)(.*?)(\$\$)/gis
str = str.replace(mathBlockRegex, function (match, p1, p2) {
return '\\\\(' + escapeMarkdown(p2) + ' \\\\)'
return '\\\\[' + escapeMarkdown(p2) + ' \\\\]'
})
let mathInlineRegex = /(\$)(.*?)(\$)/gi