mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-18 17:48:00 +08:00
fix: cherry_markdown error (#908)
* fix: first open document, cherryMarkdown not have theme * fix: modify prismjs style and improve image clarity * update cherry-markdown * optimiztion: cherry-markdown * feat: cherry-markdown add auto-save and update icon * fix: the mobile phone displays abnormally and Markdown does not allow conversion --------- Co-authored-by: zhangsheng.93 <zhangsheng.93@bytedance.com>
This commit is contained in:
@@ -34,7 +34,7 @@ func StripTags(s string) string {
|
||||
return src
|
||||
}
|
||||
|
||||
//自动提取文章摘要
|
||||
// 自动提取文章摘要
|
||||
func AutoSummary(body string, l int) string {
|
||||
|
||||
//匹配图片,如果图片语法是在代码块中,这里同样会处理
|
||||
@@ -60,7 +60,7 @@ func AutoSummary(body string, l int) string {
|
||||
return content
|
||||
}
|
||||
|
||||
//安全处理HTML文档,过滤危险标签和属性.
|
||||
// 安全处理HTML文档,过滤危险标签和属性.
|
||||
func SafetyProcessor(html string) string {
|
||||
|
||||
//安全过滤,移除危险标签和属性
|
||||
@@ -117,6 +117,8 @@ func SafetyProcessor(html string) string {
|
||||
if selector := docQuery.Find("div.markdown-article").First(); selector.Size() <= 0 {
|
||||
if selector := docQuery.Find("div.markdown-toc").First(); selector.Size() > 0 {
|
||||
docQuery.Find("div.markdown-toc").NextAll().WrapAllHtml("<div class=\"markdown-article\"></div>")
|
||||
} else if selector := docQuery.Find("dir.toc").First(); selector.Size() > 0 {
|
||||
docQuery.Find("dir.toc").NextAll().WrapAllHtml("<div class=\"markdown-article\"></div>")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user