Skip to content

Commit

Permalink
Fix for #86
Browse files Browse the repository at this point in the history
Use fetch() to get app://... assets
  • Loading branch information
alangrainger committed Apr 6, 2024
1 parent b0a756c commit c3933e9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,7 @@ export default class Note {
if (!src) continue
let content
let filepath = ''
if (src.startsWith('app://')) {
const srcMatch = src.match(/app:\/\/\w+\/([^?#]+)/)
if (srcMatch) {
filepath = window.decodeURIComponent(srcMatch[1])
content = await FileSystemAdapter.readLocalFile(filepath)
}
} else if (src.match(/^https?:\/\/localhost/) || !src.startsWith('http')) {
if (src.match(/^https?:\/\/localhost/) || !src.startsWith('http')) {
filepath = src
try {
const res = await fetch(filepath)
Expand Down

0 comments on commit c3933e9

Please sign in to comment.