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 0410ff3 commit 6f530d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ 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[1].replaceAll(/\s/g,'').includes('font-weight:bold;') || fontWeightMatch[1].replaceAll(/\s/g,'').includes('font-weight:700;')
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 6f530d0

Please sign in to comment.