mavonEditor
mavonEditor copied to clipboard
可否支持一下 SSR 文章浏览需要SEO
+1
好像不支持,刚整了半天也没成功。不过使用markdown-it插件直接string转html成功了,页面源码显示直接是标签。如果mavon-editor不支持ssr可能要放弃它了
@jjjachyty Did your problem resolved? What did you do to create SSR supported markdowns?
@jjjachyty Did your problem resolved? What did you do to create SSR supported markdowns?
use markdown-it plugin
我知道怎么支持SSR服务端渲染了,折腾半天,亲测有效,https://www.leachchen.com/ 我这个网站里面文章部分就这样处理的。样式也跟后台管理系统录入的差不多。
第一步: 导入github-markdown样式 import 'mavon-editor/dist/markdown/github-markdown.min.css'; //直接使用mavon-editor里的或者自己安装下该样式
第二步: 安装这个插件,mavon-editor里其实也用的它,npm install markdown-it
第三步: import markdownIt from "markdown-it";
第四步: var html = markdownIt({ html: true, linkify: true, typographer: true }).render(md)
第五步: 添加样式 .markdown-body { box-sizing: border-box; margin: 0 auto; padding: 25px; }
第六步: 使用 v-html显示上面的html,注意务必要添加markdown-body的class