expensify-common 2.0.76 → 2.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ExpensiMark.js +3 -2
- package/package.json +1 -1
package/dist/ExpensiMark.js
CHANGED
|
@@ -467,12 +467,13 @@ class ExpensiMark {
|
|
|
467
467
|
return isBold ? `${leadingSpace}*${trimmedContent}*${trailingSpace}` : content;
|
|
468
468
|
};
|
|
469
469
|
// Determine if the outer tag is bold
|
|
470
|
-
const
|
|
470
|
+
const fontWeightRegex = /style="([^"]*?\bfont-weight:\s*(\d+|bold|normal)[^"]*?)"/;
|
|
471
|
+
const styleAttributeMatch = match.match(fontWeightRegex);
|
|
471
472
|
const isFontWeightBold = isBoldFromStyle(styleAttributeMatch ? styleAttributeMatch[1] : null);
|
|
472
473
|
const isBold = styleAttributeMatch ? isFontWeightBold : tagName === 'b' || tagName === 'strong';
|
|
473
474
|
// Process nested spans with potential bold style
|
|
474
475
|
const processedInnerContent = innerContent.replace(/<span(?:"[^"]*"|'[^']*'|[^'">])*>([\s\S]*?)<\/span>/gi, (nestedMatch, nestedContent) => {
|
|
475
|
-
const nestedStyleMatch = nestedMatch.match(
|
|
476
|
+
const nestedStyleMatch = nestedMatch.match(fontWeightRegex);
|
|
476
477
|
const isNestedBold = isBoldFromStyle(nestedStyleMatch ? nestedStyleMatch[1] : null);
|
|
477
478
|
return updateSpacesAndWrapWithAsterisksIfBold(nestedContent, isNestedBold);
|
|
478
479
|
});
|