expensify-common 2.0.87 → 2.0.88
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 +7 -2
- package/package.json +1 -1
package/dist/ExpensiMark.js
CHANGED
|
@@ -116,8 +116,13 @@ class ExpensiMark {
|
|
|
116
116
|
// Use the url escaped version of a backtick (`) symbol. Mobile platforms do not support lookbehinds,
|
|
117
117
|
// so capture the first and third group and place them in the replacement.
|
|
118
118
|
// but we should not replace backtick symbols if they include <pre> tags between them.
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
// At least one non-whitespace character or a specific whitespace character (" " and "\u00A0")
|
|
120
|
+
// must be present inside the backticks.
|
|
121
|
+
regex: /(\B|_|)`((?:`)*(?!`).*?[\S| |\u00A0]+?.*?(?<!`)(?:`)*)`(\B|_|)(?!`|[^<]*<\/pre>|[^<]*<\/video>)/gm,
|
|
122
|
+
replacement: (_extras, _match, g1, g2, g3) => {
|
|
123
|
+
const g2Value = g2.trim() === '' ? g2.replaceAll(' ', ' ') : g2;
|
|
124
|
+
return `${g1}<code>${g2Value}</code>${g3}`;
|
|
125
|
+
},
|
|
121
126
|
},
|
|
122
127
|
/**
|
|
123
128
|
* Converts markdown style links to anchor tags e.g. [Expensify](concierge@expensify.com)
|