Skip to content

Commit

Permalink
feat: publish v0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
1943time committed Sep 23, 2023
1 parent 448ece0 commit 8b7652b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bluestone",
"version": "0.9.0",
"version": "0.9.1",
"description": "",
"main": "./out/main/index.js",
"license": "AGPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/editor/elements/media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function Media({element, attributes, children}: ElementProps<MediaNode>)
buffer: toArrayBuffer(res.rawBody)
}).then(res => {
Transforms.setNodes(store.editor, {
url: res, downloadUrl: undefined
url: res, downloadUrl: undefined, alt: ''
}, {at: state().path})
})
})
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/editor/plugins/htmlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const findElementByNode = (node: ChildNode) => {
const index = Array.prototype.indexOf.call(node.parentNode!.childNodes, node)
return node.parentElement!.children[index] as HTMLElement
}
const fragment = new Set(['body', 'figure', 'div'])
const fragment = new Set(['body', 'figure', 'div', 'figcaption'])
const ELEMENT_TAGS = {
BLOCKQUOTE: () => ({type: 'blockquote'}),
H1: () => ({type: 'head', level: 1}),
Expand Down Expand Up @@ -138,7 +138,7 @@ const processFragment = (fragment: any[]) => {
f.text = f.text.replace(/^\n+|\n+$/g, '')
if (!f.text) continue
}
if (['media', 'link'].includes(f.type)) {
if ((!f.type && f.text) || ['media', 'link'].includes(f.type)) {
f = {type: 'paragraph', children: [f]}
}
if (f.type === 'list-item') {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/editor/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export class EditorStore {
}
writeFileSync(targetPath, new DataView(buffer))
if (treeStore.root) treeStore.watcher.onChange('update', targetPath)
return mediaUrl
return window.api.toUnix(mediaUrl)
}
insertDragFile(dragNode: IFileItem) {
const note = treeStore.currentTab.current
Expand Down

0 comments on commit 8b7652b

Please sign in to comment.