expensify-common 2.0.145 → 2.0.147

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.
@@ -155,7 +155,7 @@ export default class ExpensiMark {
155
155
  /**
156
156
  * Replaces HTML with markdown
157
157
  */
158
- htmlToMarkdown(htmlString: string, extras?: Extras, maxBodyLength?: number): string;
158
+ htmlToMarkdown(htmlString: string, extras?: Extras): string;
159
159
  /**
160
160
  * Convert HTML to text
161
161
  */
@@ -1051,7 +1051,7 @@ class ExpensiMark {
1051
1051
  /**
1052
1052
  * Replaces HTML with markdown
1053
1053
  */
1054
- htmlToMarkdown(htmlString, extras = EXTRAS_DEFAULT, maxBodyLength = 0) {
1054
+ htmlToMarkdown(htmlString, extras = EXTRAS_DEFAULT) {
1055
1055
  let generatedMarkdown = htmlString;
1056
1056
  const body = /<(body)(?:"[^"]*"|'[^']*'|[^'"><])*>(?:\n|\r\n)?([\s\S]*?)(?:\n|\r\n)?<\/\1>(?![^<]*(<\/pre>|<\/code>))/im;
1057
1057
  const parseBodyTag = generatedMarkdown.match(body);
@@ -1059,17 +1059,6 @@ class ExpensiMark {
1059
1059
  if (parseBodyTag) {
1060
1060
  generatedMarkdown = parseBodyTag[2];
1061
1061
  }
1062
- if (maxBodyLength > 0) {
1063
- /*
1064
- * Some HTML sources (such as Microsoft Word) have headers larger than the typical maxLength of
1065
- * 10K even for a small body text. So the text is truncated after extracting the body element, to
1066
- * maximise the amount of body text that is included while still staying inside the length limit.
1067
- *
1068
- * The truncation happens before HTML to Markdown conversion, as the conversion is very slow for
1069
- * large input especially on mobile devices.
1070
- */
1071
- generatedMarkdown = generatedMarkdown.slice(0, maxBodyLength);
1072
- }
1073
1062
  generatedMarkdown = this.unpackNestedQuotes(generatedMarkdown);
1074
1063
  const processRule = (rule) => {
1075
1064
  // Pre-processes input HTML before applying regex
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.145",
3
+ "version": "2.0.147",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",