Skip to content

Commit

Permalink
update expensify-common version (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertKozik authored Mar 12, 2024
1 parent 65d8dcb commit 2422e5f
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 46 deletions.
2 changes: 1 addition & 1 deletion parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function parseTreeToTextAndRanges(tree: StackItem): [string, Range[]] {
appendSyntax(')');
}
} else {
throw new Error(`Unknown tag: {node.tag}`);
throw new Error(`Unknown tag: ${node.tag}`);
}
}
}
Expand Down
44 changes: 22 additions & 22 deletions parser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"expensify-common": "git+ssh://[email protected]/Expensify/expensify-common.git#a8ed0f8e1be3a1e09016e07a74cfd13c85bbc167",
"expensify-common": "git+ssh://[email protected]/Expensify/expensify-common.git#77d0b150ba6bfbe7a64b3c3e30b65592b2e58c4a",
"patch-package": "^8.0.0",
"underscore": "^1.13.6"
}
Expand Down
42 changes: 25 additions & 17 deletions parser/patches/expensify-common+1.0.0.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
diff --git a/node_modules/expensify-common/lib/CONST.jsx b/node_modules/expensify-common/lib/CONST.jsx
index 4225717..0ae0962 100644
index a8efadf..8b7ca6d 100644
--- a/node_modules/expensify-common/lib/CONST.jsx
+++ b/node_modules/expensify-common/lib/CONST.jsx
@@ -351,7 +351,7 @@ export const CONST = {
@@ -356,14 +356,14 @@ export const CONST = {
*
* @type RegExp
*/
- EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,
+ EMOJIS: /[\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,

/**
* Regex matching an text containing an Emoji that can be a single emoji or made up by some different emojis
*
* @type RegExp
*/
- EMOJI_RULE: /[\p{Extended_Pictographic}](\u200D[\p{Extended_Pictographic}]|[\u{1F3FB}-\u{1F3FF}]|[\u{E0020}-\u{E007F}]|\uFE0F|\u20E3)*|[\u{1F1E6}-\u{1F1FF}]{2}|[#*0-9]\uFE0F?\u20E3/gu,
+ EMOJI_RULE: /^(?!x)x/gu,
},

REPORT: {
diff --git a/node_modules/expensify-common/lib/ExpensiMark.js b/node_modules/expensify-common/lib/ExpensiMark.js
index 4e149ca..c94b383 100644
index f835d84..c65d2c6 100644
--- a/node_modules/expensify-common/lib/ExpensiMark.js
+++ b/node_modules/expensify-common/lib/ExpensiMark.js
@@ -7,8 +7,8 @@ const MARKDOWN_LINK_REGEX = new RegExp(`\\[([^\\][]*(?:\\[[^\\][]*][^\\][]*)*)]\
Expand All @@ -26,16 +34,16 @@ index 4e149ca..c94b383 100644
/**
* The list of regex replacements to do on a comment. Check the link regex is first so links are processed
* before other delimiters
@@ -457,7 +457,7 @@ export default class ExpensiMark {
* @type {Object[]}
@@ -489,7 +489,7 @@ export default class ExpensiMark {
* @type {Number}
*/
this.shouldKeepWhitespaceRules = this.rules.filter(rule => !this.whitespaceRulesToDisable.includes(rule.name)).map(rule => rule.name);
this.currentQuoteDepth = 0;
- }
+ },

/**
* Replaces markdown with html elements
@@ -503,7 +503,7 @@ export default class ExpensiMark {
@@ -535,7 +535,7 @@ export default class ExpensiMark {
}

return replacedText;
Expand All @@ -44,7 +52,7 @@ index 4e149ca..c94b383 100644

/**
* Checks matched URLs for validity and replace valid links with html elements
@@ -610,7 +610,7 @@ export default class ExpensiMark {
@@ -642,7 +642,7 @@ export default class ExpensiMark {
}

return replacedText;
Expand All @@ -53,7 +61,7 @@ index 4e149ca..c94b383 100644

/**
* Checks matched Emails for validity and replace valid links with html elements
@@ -649,7 +649,7 @@ export default class ExpensiMark {
@@ -681,7 +681,7 @@ export default class ExpensiMark {
replacedText = replacedText.concat(textToCheck.substr(startIndex));
}
return replacedText;
Expand All @@ -62,7 +70,7 @@ index 4e149ca..c94b383 100644

/**
* replace block element with '\n' if :
@@ -689,7 +689,7 @@ export default class ExpensiMark {
@@ -721,7 +721,7 @@ export default class ExpensiMark {
});

return joinedText;
Expand All @@ -71,7 +79,7 @@ index 4e149ca..c94b383 100644

/**
* Replaces HTML with markdown
@@ -716,7 +716,7 @@ export default class ExpensiMark {
@@ -748,7 +748,7 @@ export default class ExpensiMark {
generatedMarkdown = generatedMarkdown.replace(rule.regex, rule.replacement);
});
return Str.htmlDecode(this.replaceBlockElementWithNewLine(generatedMarkdown));
Expand All @@ -80,7 +88,7 @@ index 4e149ca..c94b383 100644

/**
* Convert HTML to text
@@ -735,7 +735,7 @@ export default class ExpensiMark {
@@ -767,7 +767,7 @@ export default class ExpensiMark {
// We use 'htmlDecode' instead of 'unescape' to replace entities like ' '
replacedText = Str.htmlDecode(replacedText);
return replacedText;
Expand All @@ -89,7 +97,7 @@ index 4e149ca..c94b383 100644

/**
* Modify text for Quotes replacing chevrons with html elements
@@ -798,7 +798,7 @@ export default class ExpensiMark {
@@ -830,7 +830,7 @@ export default class ExpensiMark {
replacedText = textToCheck;
}
return replacedText;
Expand All @@ -98,7 +106,7 @@ index 4e149ca..c94b383 100644

/**
* Format the content of blockquote if the text matches the regex or else just return the original text
@@ -819,7 +819,7 @@ export default class ExpensiMark {
@@ -851,7 +851,7 @@ export default class ExpensiMark {
return replacement(textToFormat);
}
return textToCheck;
Expand All @@ -107,7 +115,7 @@ index 4e149ca..c94b383 100644

/**
* Check if the input text includes only the open or the close tag of an element.
@@ -858,7 +858,7 @@ export default class ExpensiMark {
@@ -890,7 +890,7 @@ export default class ExpensiMark {

// If there are any tags left in the stack, they're unclosed
return tagStack.length !== 0;
Expand All @@ -116,7 +124,7 @@ index 4e149ca..c94b383 100644

/**
* @param {String} comment
@@ -880,7 +880,7 @@ export default class ExpensiMark {
@@ -912,7 +912,7 @@ export default class ExpensiMark {
console.warn('Error parsing url in ExpensiMark.extractLinksInMarkdownComment', {error: e});
return undefined;
}
Expand All @@ -125,7 +133,7 @@ index 4e149ca..c94b383 100644

/**
* Compares two markdown comments and returns a list of the links removed in a new comment.
@@ -895,3 +895,5 @@ export default class ExpensiMark {
@@ -927,3 +927,5 @@ export default class ExpensiMark {
return linksInOld === undefined || linksInNew === undefined ? [] : _.difference(linksInOld, linksInNew);
}
}
Expand Down
8 changes: 4 additions & 4 deletions parser/react-native-live-markdown-parser.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ const styles = StyleSheet.create({
borderWidth: 1,
borderStyle: 'solid',
fontFamily: 'sans-serif',
// @ts-expect-error it works on web
boxSizing: 'border-box',
whiteSpace: 'pre-wrap',
overflowY: 'auto',
Expand Down

0 comments on commit 2422e5f

Please sign in to comment.