expensify-common 2.0.41 → 2.0.43
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/CONST.d.ts +0 -6
- package/dist/CONST.js +0 -7
- package/dist/ExpensiMark.js +6 -6
- package/package.json +1 -1
package/dist/CONST.d.ts
CHANGED
|
@@ -325,12 +325,6 @@ declare const CONST: {
|
|
|
325
325
|
* @type String
|
|
326
326
|
*/
|
|
327
327
|
readonly MARKDOWN_EMAIL: "(?=((?=[\\w'#%+-]+(?:\\.[\\w'#%+-]+)*@)[\\w\\.'#%+-]{1,64}@(?:(?=[a-z\\d]+(?:-+[a-z\\d]+)*\\.)(?:[a-z\\d-]{1,63}\\.)+[a-z]{2,63})(?= |_|\\b))(?<end>.*))\\S{3,254}(?=\\k<end>$)";
|
|
328
|
-
/**
|
|
329
|
-
* Regex matching an text containing an Emoji
|
|
330
|
-
*
|
|
331
|
-
* @type RegExp
|
|
332
|
-
*/
|
|
333
|
-
readonly EMOJIS: RegExp;
|
|
334
328
|
/**
|
|
335
329
|
* Regex matching an text containing an Emoji that can be a single emoji or made up by some different emojis
|
|
336
330
|
*
|
package/dist/CONST.js
CHANGED
|
@@ -333,13 +333,6 @@ const CONST = {
|
|
|
333
333
|
* @type String
|
|
334
334
|
*/
|
|
335
335
|
MARKDOWN_EMAIL: EMAIL_BASE_REGEX,
|
|
336
|
-
/**
|
|
337
|
-
* Regex matching an text containing an Emoji
|
|
338
|
-
*
|
|
339
|
-
* @type RegExp
|
|
340
|
-
*/
|
|
341
|
-
// eslint-disable-next-line no-misleading-character-class
|
|
342
|
-
EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,
|
|
343
336
|
/**
|
|
344
337
|
* Regex matching an text containing an Emoji that can be a single emoji or made up by some different emojis
|
|
345
338
|
*
|
package/dist/ExpensiMark.js
CHANGED
|
@@ -107,7 +107,7 @@ class ExpensiMark {
|
|
|
107
107
|
return this.modifyTextForEmailLinks(regex, textToProcess, replacement, shouldKeepRawInput);
|
|
108
108
|
},
|
|
109
109
|
replacement: (_extras, match, g1, g2) => {
|
|
110
|
-
if (
|
|
110
|
+
if (!g1.trim()) {
|
|
111
111
|
return match;
|
|
112
112
|
}
|
|
113
113
|
const label = g1.trim();
|
|
@@ -116,7 +116,7 @@ class ExpensiMark {
|
|
|
116
116
|
return `<a href="${href}">${formattedLabel}</a>`;
|
|
117
117
|
},
|
|
118
118
|
rawInputReplacement: (_extras, match, g1, g2, g3) => {
|
|
119
|
-
if (
|
|
119
|
+
if (!g1.trim()) {
|
|
120
120
|
return match;
|
|
121
121
|
}
|
|
122
122
|
const dataRawHref = g2 ? g2 + g3 : g3;
|
|
@@ -177,13 +177,13 @@ class ExpensiMark {
|
|
|
177
177
|
name: 'link',
|
|
178
178
|
process: (textToProcess, replacement) => this.modifyTextForUrlLinks(MARKDOWN_LINK_REGEX, textToProcess, replacement),
|
|
179
179
|
replacement: (_extras, match, g1, g2) => {
|
|
180
|
-
if (
|
|
180
|
+
if (!g1.trim()) {
|
|
181
181
|
return match;
|
|
182
182
|
}
|
|
183
183
|
return `<a href="${str_1.default.sanitizeURL(g2)}" target="_blank" rel="noreferrer noopener">${g1.trim()}</a>`;
|
|
184
184
|
},
|
|
185
185
|
rawInputReplacement: (_extras, match, g1, g2) => {
|
|
186
|
-
if (
|
|
186
|
+
if (!g1.trim()) {
|
|
187
187
|
return match;
|
|
188
188
|
}
|
|
189
189
|
return `<a href="${str_1.default.sanitizeURL(g2)}" data-raw-href="${g2}" data-link-variant="labeled" target="_blank" rel="noreferrer noopener">${g1.trim()}</a>`;
|
|
@@ -894,8 +894,8 @@ class ExpensiMark {
|
|
|
894
894
|
if (text.trim().length === 0 && !text.match(/\n/)) {
|
|
895
895
|
return;
|
|
896
896
|
}
|
|
897
|
-
// Insert '\n' unless it ends with '\n' or '>' or it's the last element.
|
|
898
|
-
if (text.match(/[\n|>][>]?[\s]?$/) || index === splitText.length - 1) {
|
|
897
|
+
// Insert '\n' unless it ends with '\n' or '>' or it's the last element, or if it's a header ('# ') with a space.
|
|
898
|
+
if (text.match(/[\n|>][>]?[\s]?$/) || index === splitText.length - 1 || text === '# ') {
|
|
899
899
|
joinedText += text;
|
|
900
900
|
}
|
|
901
901
|
else {
|