Skip to content

Commit

Permalink
fix: #692 闪卡标记渲染成Markdown之后去除==
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 31, 2023
1 parent 02a243a commit 0e1e7f1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/adaptors/base/baseExtendApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,18 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi {
const post = _.cloneDeep(doc) as Post

// 处理MD
let md = post.markdown

// #435 过滤掉思源剪藏插件的引用摘要
const md = post.markdown
post.markdown = YamlUtil.extractMarkdown(md)
this.logger.debug("markdown处理完毕,post", { post: toRaw(post) })
md = YamlUtil.extractMarkdown(md)

// 处理标记
// #691 闪卡标记渲染成Markdown之后去除==
md = md.replace(/==([^=]+)==/g, '<span style="font-weight: bold;" class="mark">$1</span>')

// 汇总结果
post.markdown = md
this.logger.debug("markdown处理完毕,post", { post: toRaw(post) })
return post
}

Expand Down

0 comments on commit 0e1e7f1

Please sign in to comment.