merge #228: markdown manual preview refresh (MuziIsabel)

# Conflicts:
#	src/client/EditorHost.tsx
#	src/client/TextEditor.tsx
This commit is contained in:
HuanLinOTO
2026-08-24 01:34:55 +08:00
5 changed files with 182 additions and 3 deletions
+2
View File
@@ -93,6 +93,7 @@ export const zh = {
mermaidZoomReset: '重置',
mermaidZoomHint: '滚轮缩放 · 拖拽平移 · Esc 关闭',
refresh: '刷新',
refreshUnsavedConfirm: '文件已在磁盘更新,刷新将丢弃未保存编辑。继续吗?',
save: '保存',
saved: '已保存',
unsaved: '未保存',
@@ -430,6 +431,7 @@ export const en: Record<keyof typeof zh, string> = {
mermaidZoomReset: 'Reset',
mermaidZoomHint: 'Scroll to zoom · drag to pan · Esc to close',
refresh: 'Refresh',
refreshUnsavedConfirm: 'The file changed on disk. Refreshing will discard unsaved edits. Continue?',
save: 'Save',
saved: 'Saved',
unsaved: 'Unsaved',
+7 -1
View File
@@ -180,7 +180,13 @@ async function readText(path: string, readLimit: number): Promise<{
const head = binary
? slice.subarray(0, Math.min(slice.length, READ_HEAD_LIMIT)).toString('base64')
: undefined
return { content: binary ? '' : slice.toString('utf8'), truncated, binary, size, head }
return {
content: binary ? '' : slice.toString('utf8'),
truncated,
binary,
size,
head,
}
} finally {
await handle.close()
}