mavonEditor icon indicating copy to clipboard operation
mavonEditor copied to clipboard

可否支持一下 SSR 文章浏览需要SEO

Open jjjachyty opened this issue 7 years ago • 5 comments
trafficstars

jjjachyty avatar Jul 17 '18 11:07 jjjachyty

+1

proc07 avatar Sep 05 '18 01:09 proc07

好像不支持,刚整了半天也没成功。不过使用markdown-it插件直接string转html成功了,页面源码显示直接是标签。如果mavon-editor不支持ssr可能要放弃它了

chf-gh avatar Nov 29 '18 06:11 chf-gh

@jjjachyty Did your problem resolved? What did you do to create SSR supported markdowns?

ZaidRehman avatar Nov 23 '20 09:11 ZaidRehman

@jjjachyty Did your problem resolved? What did you do to create SSR supported markdowns?

use markdown-it plugin

chf-gh avatar Dec 09 '20 07:12 chf-gh

我知道怎么支持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

leach-chen avatar Feb 07 '23 14:02 leach-chen