1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Merge pull request #732 from asmsuechan/fix-image-path-on-dropped

Make it work on windows
This commit is contained in:
SuenagaRyota
2017-07-26 15:55:30 +09:00
committed by GitHub

View File

@@ -285,7 +285,7 @@ export default class MarkdownPreview extends React.Component {
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('img'), (el) => {
if (!/\/:storage/.test(el.src)) return
el.src = el.src.replace('/:storage', path.join(storagePath, 'images'))
el.src = `file:///${path.join(storagePath, 'images', path.basename(el.src))}`
})
codeBlockTheme = consts.THEMES.some((_theme) => _theme === codeBlockTheme)