Skip to content

Commit a193ba3

Browse files
authored
Merge pull request #732 from asmsuechan/fix-image-path-on-dropped
Make it work on windows
2 parents e864645 + 9034b3a commit a193ba3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

browser/components/MarkdownPreview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export default class MarkdownPreview extends React.Component {
285285

286286
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('img'), (el) => {
287287
if (!/\/:storage/.test(el.src)) return
288-
el.src = el.src.replace('/:storage', path.join(storagePath, 'images'))
288+
el.src = `file:///${path.join(storagePath, 'images', path.basename(el.src))}`
289289
})
290290

291291
codeBlockTheme = consts.THEMES.some((_theme) => _theme === codeBlockTheme)

0 commit comments

Comments
 (0)