expensify-common 2.0.7 → 2.0.9
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 +5 -5
- package/package.json +1 -1
package/dist/ExpensiMark.js
CHANGED
|
@@ -75,9 +75,8 @@ class ExpensiMark {
|
|
|
75
75
|
return `<pre>${group}</pre>`;
|
|
76
76
|
},
|
|
77
77
|
rawInputReplacement: (match, __, textWithinFences) => {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
return `<pre data-code-raw="${withinFences}">${group}</pre>`;
|
|
78
|
+
const group = textWithinFences.replace(/(?:(?![\n\r])\s)/g, ' ').replace(/<emoji>|<\/emoji>/g, '');
|
|
79
|
+
return `<pre>${group}</pre>`;
|
|
81
80
|
},
|
|
82
81
|
},
|
|
83
82
|
/**
|
|
@@ -188,7 +187,7 @@ class ExpensiMark {
|
|
|
188
187
|
*/
|
|
189
188
|
{
|
|
190
189
|
name: 'reportMentions',
|
|
191
|
-
regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,80})/gimu,
|
|
190
|
+
regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,80})(?![^<]*(?:<\/pre>|<\/code>))/gimu,
|
|
192
191
|
replacement: '<mention-report>$1</mention-report>',
|
|
193
192
|
},
|
|
194
193
|
/**
|
|
@@ -253,7 +252,8 @@ class ExpensiMark {
|
|
|
253
252
|
const regex = /^(?:>)+ +(?! )(?![^<]*(?:<\/pre>|<\/code>))([^\v\n\r]+)/gm;
|
|
254
253
|
const replaceFunction = (g1) => replacement(g1, shouldKeepRawInput);
|
|
255
254
|
if (shouldKeepRawInput) {
|
|
256
|
-
|
|
255
|
+
const rawInputRegex = /^(?:>)+ +(?! )(?![^<]*(?:<\/pre>|<\/code>))([^\v\n\r]*)/gm;
|
|
256
|
+
return textToProcess.replace(rawInputRegex, replaceFunction);
|
|
257
257
|
}
|
|
258
258
|
return this.modifyTextForQuote(regex, textToProcess, replacement);
|
|
259
259
|
},
|