diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index 94bc7f68..8533148a 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -311,7 +311,7 @@ export default class ExpensiMark { // \B will match everything that \b doesn't, so it works // for * and ~: https://www.rexegg.com/regex-boundaries.html#notb name: 'bold', - regex: /\B\*((?![\s*])[\s\S]*?[^\s*])\*\B(?![^<]*(<\/pre>|<\/code>|<\/a>))/g, + regex: /\B\*(?![^<]*(?:<\/pre>|<\/code>|<\/a>))((?![\s*])[\s\S]*?[^\s*])\*\B(?![^<]*(<\/pre>|<\/code>|<\/a>))/g, replacement: (match, g1) => (g1.includes('') || this.containsNonPairTag(g1) ? match : `${g1}`), }, {