mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix: 修复非 markdown 文件预览问题
This commit is contained in:
@@ -134,7 +134,7 @@ export default defineComponent({
|
||||
// 编辑非 markdown 文件预览直接显示代码
|
||||
const content = (filePath.value || '').endsWith('.md')
|
||||
? currentContent.value
|
||||
: '```' + extname(fileName.value || '').replace(/^\./, '') + '\n' + currentContent.value + '```'
|
||||
: '```' + extname(fileName.value || '').replace(/^\./, '') + '\n' + currentContent.value + '\n```'
|
||||
|
||||
renderContent.value = markdown.render(content, { source: content, file: currentFile.value })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user