Skip to content

Commit

Permalink
feat(app): support br tag
Browse files Browse the repository at this point in the history
  • Loading branch information
LincZero committed Feb 25, 2025
1 parent af4b5bd commit 89b75bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/App/src/components/MarkdownViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const props = defineProps<{
// 渲染方法
import MarkdownIt from "markdown-it";
const md = MarkdownIt()
const md = new MarkdownIt({
html: true, // 启用 HTML 标签解析
breaks: true // 将换行符转换为 <br> 标签
})
md.use(ab_mdit) // 使用anyblock插件
function fn_renderMarkdown(markdown: string, el: HTMLElement, ctx?: any): void {
if (!el) return;
Expand Down
2 changes: 0 additions & 2 deletions src/App/src/utils/preset_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ this is ~~a~~ **MarkDown** *test*
`,
//
'list2table (列表转多叉表格)': `\
(不知道为什么 br 标签在这里失效了, 在ob和在vuepress环境都是能用的)
[list2table]
- Gymnosperm<br> 裸子植物
Expand Down

0 comments on commit 89b75bb

Please sign in to comment.