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.
@@ -75,9 +75,8 @@ class ExpensiMark {
75
75
  return `<pre>${group}</pre>`;
76
76
  },
77
77
  rawInputReplacement: (match, __, textWithinFences) => {
78
- const withinFences = match.replace(/(?:&#x60;&#x60;&#x60;)([\s\S]*?)(?:&#x60;&#x60;&#x60;)/g, '$1');
79
- const group = textWithinFences.replace(/(?:(?![\n\r])\s)/g, '&#32;');
80
- return `<pre data-code-raw="${withinFences}">${group}</pre>`;
78
+ const group = textWithinFences.replace(/(?:(?![\n\r])\s)/g, '&#32;').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 = /^(?:&gt;)+ +(?! )(?![^<]*(?:<\/pre>|<\/code>))([^\v\n\r]+)/gm;
254
253
  const replaceFunction = (g1) => replacement(g1, shouldKeepRawInput);
255
254
  if (shouldKeepRawInput) {
256
- return textToProcess.replace(regex, replaceFunction);
255
+ const rawInputRegex = /^(?:&gt;)+ +(?! )(?![^<]*(?:<\/pre>|<\/code>))([^\v\n\r]*)/gm;
256
+ return textToProcess.replace(rawInputRegex, replaceFunction);
257
257
  }
258
258
  return this.modifyTextForQuote(regex, textToProcess, replacement);
259
259
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",