expensify-common 2.0.113 → 2.0.115

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.
@@ -131,13 +131,14 @@ class ExpensiMark {
131
131
  // At least one non-whitespace character or a specific whitespace character (" " and "\u00A0")
132
132
  // must be present inside the backticks.
133
133
  regex: /(\B|_|)&#x60;(.*?)&#x60;(\B|_|)(?!(?!<pre>)[^<]*(?:<(?!pre>)[^<]*)*<\/pre>|[^<]*<\/video>)/gm,
134
- replacement: (_extras, _match, g1, g2, g3) => {
134
+ replacement: (_extras, match, g1, g2, g3) => {
135
135
  const g2Value = g2.trim() === '' ? g2.replaceAll(' ', '&nbsp;') : g2;
136
136
  if (!g2Value) {
137
- return _match;
137
+ return match;
138
138
  }
139
139
  return `${g1}<code>${g2Value}</code>${g3}`;
140
140
  },
141
+ rawInputReplacement: (_extras, match, g1, g2, g3) => (g2 ? `${g1}<code>${g2}</code>${g3}` : match),
141
142
  },
142
143
  /**
143
144
  * Converts markdown style links to anchor tags e.g. [Expensify](concierge@expensify.com)
@@ -663,6 +664,16 @@ class ExpensiMark {
663
664
  regex: /<img[^><]*src\s*=\s*(['"])(.*?)\1(?:[^><]*alt\s*=\s*(['"])(.*?)\3)?[^><]*>*(?![^<][\s\S]*?(<\/pre>|<\/code>))/gi,
664
665
  replacement: '[Attachment]',
665
666
  },
667
+ {
668
+ name: 'video',
669
+ regex: /<video[^><]*data-expensify-source\s*=\s*(['"])(\S*?)\1(.*?)>([^><]*)<\/video>*(?![^<][\s\S]*?(<\/pre>|<\/code>))/gi,
670
+ replacement: '[Attachment]',
671
+ },
672
+ {
673
+ name: 'otherAttachments',
674
+ regex: /<a[^><]*data-expensify-source\s*=\s*(['"])(\S*?)\1(.*?)>([^><]*)<\/a>*(?![^<][\s\S]*?(<\/pre>|<\/code>))/gi,
675
+ replacement: '[Attachment]',
676
+ },
666
677
  {
667
678
  name: 'reportMentions',
668
679
  regex: /<mention-report reportID="(\d+)" *\/>/gi,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.113",
3
+ "version": "2.0.115",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",