Skip to content

Commit

Permalink
Update ExpensiMark.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ShridharGoel authored Jun 13, 2024
1 parent 6f530d0 commit 559a940
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ export default class ExpensiMark {
regex: /<(b|strong)(?:"[^"]*"|'[^']*'|[^'">])*>([\s\S]*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))/gi,
replacement: (match, tagContent, innerContent) => {
const fontWeightMatch = innerContent.match(/style="(.*?)"/);
const isFontWeightBold = fontWeightMatch ? fontWeightMatch[1].replaceAll(/\s/g,'').includes('font-weight:bold;') || fontWeightMatch[1].replaceAll(/\s/g,'').includes('font-weight:700;') : false;
const isFontWeightBold = fontWeightMatch
? fontWeightMatch[1].replaceAll(/\s/g, "").includes("font-weight:bold;") ||
fontWeightMatch[1].replaceAll(/\s/g, "").includes("font-weight:700;")
: false;
const isBold = fontWeightMatch ? isFontWeightBold : true;
return isBold ? `*${innerContent}*` : innerContent;
},
Expand Down

0 comments on commit 559a940

Please sign in to comment.