expensify-common 2.0.20 → 2.0.22
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 +14 -4
- package/package.json +2 -2
package/dist/ExpensiMark.js
CHANGED
|
@@ -935,9 +935,17 @@ class ExpensiMark {
|
|
|
935
935
|
// We need to know when there is a start of codefence so we dont quote
|
|
936
936
|
insideCodefence = str_1.default.contains(textSplitted[i], '<pre>');
|
|
937
937
|
}
|
|
938
|
-
//
|
|
939
|
-
|
|
940
|
-
|
|
938
|
+
// Since the last space will be trimmed and would incorrectly disable a condition we check it manually
|
|
939
|
+
const isLastBlockquote = textSplitted[i] === '>' && i === textSplitted.length - 1;
|
|
940
|
+
// We only want to modify lines starting with "> " that is not codefence
|
|
941
|
+
if ((str_1.default.startsWith(textSplitted[i], '> ') || isLastBlockquote) && !insideCodefence) {
|
|
942
|
+
if (textSplitted[i] === '>') {
|
|
943
|
+
textToFormat += `${textSplitted[i]} \n`;
|
|
944
|
+
insideCodefence = true;
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
textToFormat += `${textSplitted[i]}\n`;
|
|
948
|
+
}
|
|
941
949
|
}
|
|
942
950
|
else {
|
|
943
951
|
// Make sure we will only modify if we have Text needed to be formatted for quote
|
|
@@ -976,7 +984,9 @@ class ExpensiMark {
|
|
|
976
984
|
if (textToCheck.match(regex)) {
|
|
977
985
|
// Remove '>' and trim the spaces between nested quotes
|
|
978
986
|
const formatRow = (row) => {
|
|
979
|
-
|
|
987
|
+
let quoteContent = row[4] === ' ' ? row.substr(5) : row.substr(4);
|
|
988
|
+
if (row === '> ')
|
|
989
|
+
quoteContent = row.substr(4);
|
|
980
990
|
if (quoteContent.trimStart().startsWith('>')) {
|
|
981
991
|
return quoteContent.trimStart();
|
|
982
992
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expensify-common",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22",
|
|
4
4
|
"author": "Expensify, Inc.",
|
|
5
5
|
"description": "Expensify libraries and components shared across different repos",
|
|
6
6
|
"homepage": "https://expensify.com",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/react-dom": "^18.3.0",
|
|
53
53
|
"@types/ua-parser-js": "^0.7.39",
|
|
54
54
|
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
55
|
-
"@typescript-eslint/parser": "^7.
|
|
55
|
+
"@typescript-eslint/parser": "^7.11.0",
|
|
56
56
|
"babel-jest": "^29.0.0",
|
|
57
57
|
"babelify": "10.0.0",
|
|
58
58
|
"eslint": "^8.57.0",
|