Skip to content

Commit

Permalink
fix: #821 html发布的时候会出现有些格式没有转化
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Oct 28, 2023
1 parent 3cbfcd6 commit 4c44dbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/adaptors/base/baseExtendApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi {
// #691 闪卡标记渲染成Markdown之后去除==
md = md.replace(/==([^=]+)==/g, '<span style="font-weight: bold;" class="mark">$1</span>')

// 处理加粗
// #821 html发布的时候会出现有些格式没有转化
// **这里是加粗**
// <p id="2<span data-type="strong">这里是加粗</span>
// md = md.replace(/\*\*(.*?)\*\*/g, '<span style="font-weight: bold;" data-type="strong">$1</span>')
md = md.replace(/\*\*(.*?)\*\*/g, '<span style="font-weight: bold;" data-type="strong">$1</span>')

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

0 comments on commit 4c44dbf

Please sign in to comment.