Skip to content

Commit

Permalink
fix: #990 修复加粗语法在特定情况下无法命中的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Dec 17, 2024
1 parent 3d0020c commit e30e7ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/hooks/Emphasis.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default class Emphasis extends SyntaxBase {
};
let $str = str;
if (this.allowWhitespace) {
$str = $str.replace(/(^|\n[\s]*)(\*)([^\s*](?:.*?)(?:(?:\n.*?)*?))\*/g, converAsterisk);
$str = $str.replace(/(^|\n[\s]*)(\*{2,})((?:.*?)(?:(?:\n.*?)*?))\2/g, converAsterisk);
$str = $str.replace(/(^[\s]*|\n[\s]*)(\*)([^\s*](?:.*?)(?:(?:\n.*?)*?))\*/g, converAsterisk);
$str = $str.replace(/(^[\s]*|\n[\s]*)(\*{2,})((?:.*?)(?:(?:\n.*?)*?))\2/g, converAsterisk);
$str = $str.replace(/([^\n*\\\s][ ]*)(\*+)((?:.*?)(?:(?:\n.*?)*?))\2/g, converAsterisk);
} else {
// TODO: fix this error
Expand Down

0 comments on commit e30e7ee

Please sign in to comment.