fix: automatically convert Super notes to Markdown for the Plaintext Backups feature

This commit is contained in:
Mo
2023-05-02 15:37:23 -05:00
parent 2eddc3a1c6
commit 75ecf4c393
11 changed files with 88 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
import { WebApplication } from '@/Application/Application'
import { exportSuperNote } from '@/Components/SuperEditor/SuperNoteExporter'
import { InvisibleSuperConverter } from '@/Components/SuperEditor/Tools/InvisibleMarkdownConverter'
import { NoteType, PrefKey, SNNote } from '@standardnotes/snjs'
export const getNoteFormat = (application: WebApplication, note: SNNote) => {
@@ -38,7 +38,8 @@ export const getNoteBlob = (application: WebApplication, note: SNNote) => {
type = 'text/plain'
break
}
const content = note.noteType === NoteType.Super ? exportSuperNote(note, format) : note.text
const content =
note.noteType === NoteType.Super ? new InvisibleSuperConverter().convertString(note.text, format) : note.text
const blob = new Blob([content], {
type,
})