Skip to content

Commit

Permalink
fix: #993 修复识别html标签的正则逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Dec 22, 2024
1 parent 2b8696f commit c58466e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/hooks/HtmlBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class HtmlBlock extends ParagraphBase {
let $str = str;
$str = convertHTMLNumberToName($str);
$str = escapeHTMLEntitiesWithoutSemicolon($str);
$str = $str.replace(/<[/]?(.*?)>/g, (whole, m1) => {
$str = $str.replace(/<[/]?([^<]*?)>/g, (whole, m1) => {
// 匹配到非白名单且非AutoLink语法的尖括号会被转义
// 如果是HTML注释,放行
if (!whiteList.test(m1) && !this.isAutoLinkTag(whole) && !this.isHtmlComment(whole)) {
Expand Down

0 comments on commit c58466e

Please sign in to comment.