From 4072b1caaf4de9afdb908564f3a198ecc3a65a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Fri, 19 Jan 2024 10:14:07 +0100 Subject: [PATCH] Fix tests --- parser/index.ts | 2 +- parser/react-native-live-markdown-parser.js | 2 +- src/__tests__/index.test.tsx | 36 +++++++++++++-------- src/web/parserUtils.ts | 7 ++-- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/parser/index.ts b/parser/index.ts index 0022f0ba..24a05f40 100644 --- a/parser/index.ts +++ b/parser/index.ts @@ -160,7 +160,7 @@ function parseTreeToTextAndRanges(tree: StackItem): [string, Range[]] { } function sortRanges(ranges: Range[]) { - return ranges.sort((a, b) => a[1] - b[1] || b[2] - a[2] || a[0].localeCompare(b[0]) || 0); // sort by location to properly handle bold+italic + return ranges.sort((a, b) => a[1] - b[1] || b[2] - a[2] || 0); // sort by location to properly handle bold+italic } function parseExpensiMarkToRanges(markdown: string): Range[] { diff --git a/parser/react-native-live-markdown-parser.js b/parser/react-native-live-markdown-parser.js index 39d9c669..ed6117db 100644 --- a/parser/react-native-live-markdown-parser.js +++ b/parser/react-native-live-markdown-parser.js @@ -31,4 +31,4 @@ $2`},{name:"removeStyle",regex:/