@expensify/react-native-live-markdown 0.1.196 → 0.1.197
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/apple/MarkdownParser.mm
CHANGED
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
const auto &length = static_cast<int>(item.getProperty(rt, "length").asNumber());
|
|
47
47
|
const auto &depth = item.hasProperty(rt, "depth") ? static_cast<int>(item.getProperty(rt, "depth").asNumber()) : 1;
|
|
48
48
|
|
|
49
|
+
if (length == 0 || start + length > text.length) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
49
53
|
NSRange range = NSMakeRange(start, length);
|
|
50
54
|
MarkdownRange *markdownRange = [[MarkdownRange alloc] initWithType:@(type.c_str()) range:range depth:depth];
|
|
51
55
|
[markdownRanges addObject:markdownRange];
|
|
@@ -70,10 +70,6 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
- (void)applyRangeToAttributedString:(NSMutableAttributedString *)attributedString type:(const std::string)type range:(NSRange)range depth:(const int)depth {
|
|
73
|
-
if (range.length == 0 || range.location + range.length > attributedString.length) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
73
|
if (type == "bold" || type == "italic" || type == "code" || type == "pre" || type == "h1" || type == "emoji") {
|
|
78
74
|
UIFont *font = [attributedString attribute:NSFontAttributeName atIndex:range.location effectiveRange:NULL];
|
|
79
75
|
if (type == "bold") {
|
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.197",
|
|
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",
|