@expensify/react-native-live-markdown 0.1.341 → 0.1.343
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/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npm install @expensify/react-native-live-markdown react-native-worklets expensif
|
|
|
20
20
|
npx expo install @expensify/react-native-live-markdown react-native-worklets expensify-common html-entities@2.5.3
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
React Native Live Markdown requires [react-native-worklets](https://github.com/software-mansion/react-native-reanimated/tree/main/packages/react-native-worklets) 0.7.0 or newer as well as [expensify-common](https://github.com/Expensify/expensify-common) 2.0.
|
|
23
|
+
React Native Live Markdown requires [react-native-worklets](https://github.com/software-mansion/react-native-reanimated/tree/main/packages/react-native-worklets) 0.7.0 or newer as well as [expensify-common](https://github.com/Expensify/expensify-common) 2.0.207 or newer and [html-entities](https://github.com/mdevils/html-entities) 2.5.3 exactly if using the default built-in ExpensiMark parser.
|
|
24
24
|
|
|
25
25
|
> [!IMPORTANT]
|
|
26
26
|
> Please follow the `react-native-worklets` [Getting Started](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/getting-started/#react-native-community-cli) guide to avoid issues.
|
|
@@ -221,11 +221,12 @@ Currently, `react-native-live-markdown` supports only [ExpensiMark](https://gith
|
|
|
221
221
|
|
|
222
222
|
### `react-native-worklets` compatibility
|
|
223
223
|
|
|
224
|
-
| | 0.6.x | 0.7.x | 0.8.x | 0.9.x | 0.10.2
|
|
225
|
-
|
|
226
|
-
| 0.1.
|
|
227
|
-
| 0.1.
|
|
228
|
-
| 0.1.
|
|
224
|
+
| | 0.6.x | 0.7.x | 0.8.x | 0.9.x | 0.10.2 – 0.11.x | 0.12.x | 0.13.x |
|
|
225
|
+
|:-----------------:|:-----:|:-----:|:-----:|:-----:|:---------------:|:------:|:------:|
|
|
226
|
+
| 0.1.343+ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
227
|
+
| 0.1.333 – 0.1.342 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
|
|
228
|
+
| 0.1.321 – 0.1.332 | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
229
|
+
| 0.1.308 – 0.1.320 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
229
230
|
|
|
230
231
|
|
|
231
232
|
## License
|
|
@@ -17,7 +17,7 @@ namespace livemarkdown {
|
|
|
17
17
|
const auto markdownWorklet = expensify::livemarkdown::getMarkdownWorklet(parserId);
|
|
18
18
|
|
|
19
19
|
const auto input = jsi::String::createFromUtf8(rt, text->toStdString());
|
|
20
|
-
const auto output = markdownRuntime->
|
|
20
|
+
const auto output = markdownRuntime->runSync(markdownWorklet, input);
|
|
21
21
|
|
|
22
22
|
const auto json = rt.global().getPropertyAsObject(rt, "JSON").getPropertyAsFunction(rt, "stringify").call(rt, output).asString(rt).utf8(rt);
|
|
23
23
|
return jni::make_jstring(json);
|
|
@@ -44,7 +44,7 @@ public class MarkdownParser {
|
|
|
44
44
|
Systrace.beginSection(0, "nativeParse");
|
|
45
45
|
json = nativeParse(text, parserId);
|
|
46
46
|
} catch (Exception e) {
|
|
47
|
-
// Skip formatting,
|
|
47
|
+
// Skip formatting, runSync shows the error in LogBox in debug builds and throws in release builds
|
|
48
48
|
mPrevText = text;
|
|
49
49
|
mPrevParserId = parserId;
|
|
50
50
|
mPrevMarkdownRanges = Collections.emptyList();
|
package/apple/MarkdownParser.mm
CHANGED
|
@@ -223,9 +223,9 @@ static const NSUInteger kMarkdownParserCacheCapacity = 4;
|
|
|
223
223
|
|
|
224
224
|
jsi::Value output;
|
|
225
225
|
try {
|
|
226
|
-
output = markdownRuntime->
|
|
226
|
+
output = markdownRuntime->runSync(markdownWorklet, input);
|
|
227
227
|
} catch (const jsi::JSError &error) {
|
|
228
|
-
// Skip formatting,
|
|
228
|
+
// Skip formatting, runSync shows the error in LogBox in debug builds and throws in release builds
|
|
229
229
|
return @[];
|
|
230
230
|
}
|
|
231
231
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensify/react-native-live-markdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.343",
|
|
4
4
|
"description": "Drop-in replacement for React Native's TextInput component with Markdown formatting.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"eslint-plugin-promise": "^6.1.1",
|
|
93
93
|
"eslint-plugin-react-native": "^5.0.0",
|
|
94
94
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
95
|
-
"expensify-common": "2.0.
|
|
95
|
+
"expensify-common": "2.0.207",
|
|
96
96
|
"jest": "^29.6.3",
|
|
97
97
|
"jest-environment-jsdom": "^29.7.0",
|
|
98
98
|
"nodemon": "^3.1.3",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"typescript": "^5.8.3"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"expensify-common": ">=2.0.
|
|
112
|
+
"expensify-common": ">=2.0.207",
|
|
113
113
|
"react": "*",
|
|
114
114
|
"react-native": "*",
|
|
115
115
|
"react-native-worklets": ">=0.7.0"
|