react-native-nitro-markdown 0.4.2 → 0.5.0
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 +605 -318
- package/android/src/main/java/com/margelo/nitro/com/nitromarkdown/HybridMarkdownSession.kt +27 -8
- package/cpp/bindings/HybridMarkdownParser.cpp +216 -66
- package/cpp/bindings/HybridMarkdownParser.hpp +2 -0
- package/ios/HybridMarkdownSession.swift +33 -7
- package/lib/commonjs/MarkdownContext.js +2 -1
- package/lib/commonjs/MarkdownContext.js.map +1 -1
- package/lib/commonjs/headless.js +41 -5
- package/lib/commonjs/headless.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/markdown-stream.js +109 -13
- package/lib/commonjs/markdown-stream.js.map +1 -1
- package/lib/commonjs/markdown.js +215 -44
- package/lib/commonjs/markdown.js.map +1 -1
- package/lib/commonjs/renderers/code.js +4 -3
- package/lib/commonjs/renderers/code.js.map +1 -1
- package/lib/commonjs/renderers/heading.js +1 -1
- package/lib/commonjs/renderers/heading.js.map +1 -1
- package/lib/commonjs/renderers/image.js +7 -5
- package/lib/commonjs/renderers/image.js.map +1 -1
- package/lib/commonjs/renderers/link.js +15 -3
- package/lib/commonjs/renderers/link.js.map +1 -1
- package/lib/commonjs/renderers/list.js +2 -2
- package/lib/commonjs/renderers/list.js.map +1 -1
- package/lib/commonjs/renderers/table.js +126 -21
- package/lib/commonjs/renderers/table.js.map +1 -1
- package/lib/commonjs/use-markdown-stream.js +16 -14
- package/lib/commonjs/use-markdown-stream.js.map +1 -1
- package/lib/commonjs/utils/incremental-ast.js +153 -0
- package/lib/commonjs/utils/incremental-ast.js.map +1 -0
- package/lib/commonjs/utils/link-security.js +21 -0
- package/lib/commonjs/utils/link-security.js.map +1 -0
- package/lib/commonjs/utils/stream-timeline.js +62 -0
- package/lib/commonjs/utils/stream-timeline.js.map +1 -0
- package/lib/module/MarkdownContext.js +2 -1
- package/lib/module/MarkdownContext.js.map +1 -1
- package/lib/module/headless.js +37 -4
- package/lib/module/headless.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/markdown-stream.js +110 -14
- package/lib/module/markdown-stream.js.map +1 -1
- package/lib/module/markdown.js +217 -46
- package/lib/module/markdown.js.map +1 -1
- package/lib/module/renderers/blockquote.js.map +1 -1
- package/lib/module/renderers/code.js +4 -3
- package/lib/module/renderers/code.js.map +1 -1
- package/lib/module/renderers/heading.js +1 -1
- package/lib/module/renderers/heading.js.map +1 -1
- package/lib/module/renderers/image.js +7 -5
- package/lib/module/renderers/image.js.map +1 -1
- package/lib/module/renderers/link.js +15 -3
- package/lib/module/renderers/link.js.map +1 -1
- package/lib/module/renderers/list.js +2 -2
- package/lib/module/renderers/list.js.map +1 -1
- package/lib/module/renderers/paragraph.js.map +1 -1
- package/lib/module/renderers/table.js +127 -22
- package/lib/module/renderers/table.js.map +1 -1
- package/lib/module/use-markdown-stream.js +16 -14
- package/lib/module/use-markdown-stream.js.map +1 -1
- package/lib/module/utils/incremental-ast.js +147 -0
- package/lib/module/utils/incremental-ast.js.map +1 -0
- package/lib/module/utils/link-security.js +15 -0
- package/lib/module/utils/link-security.js.map +1 -0
- package/lib/module/utils/stream-timeline.js +56 -0
- package/lib/module/utils/stream-timeline.js.map +1 -0
- package/lib/typescript/commonjs/Markdown.nitro.d.ts +5 -3
- package/lib/typescript/commonjs/Markdown.nitro.d.ts.map +1 -1
- package/lib/typescript/commonjs/MarkdownContext.d.ts +26 -25
- package/lib/typescript/commonjs/MarkdownContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/headless.d.ts +15 -2
- package/lib/typescript/commonjs/headless.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/markdown-stream.d.ts +7 -2
- package/lib/typescript/commonjs/markdown-stream.d.ts.map +1 -1
- package/lib/typescript/commonjs/markdown.d.ts +62 -5
- package/lib/typescript/commonjs/markdown.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/blockquote.d.ts +3 -3
- package/lib/typescript/commonjs/renderers/blockquote.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/code.d.ts +5 -5
- package/lib/typescript/commonjs/renderers/code.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/heading.d.ts +3 -3
- package/lib/typescript/commonjs/renderers/heading.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/horizontal-rule.d.ts +2 -2
- package/lib/typescript/commonjs/renderers/horizontal-rule.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/image.d.ts +2 -2
- package/lib/typescript/commonjs/renderers/image.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/link.d.ts +3 -3
- package/lib/typescript/commonjs/renderers/link.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/list.d.ts +7 -7
- package/lib/typescript/commonjs/renderers/list.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/math.d.ts +4 -4
- package/lib/typescript/commonjs/renderers/math.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/paragraph.d.ts +3 -3
- package/lib/typescript/commonjs/renderers/paragraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/renderers/table.d.ts +3 -3
- package/lib/typescript/commonjs/renderers/table.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/MarkdownSession.nitro.d.ts +5 -2
- package/lib/typescript/commonjs/specs/MarkdownSession.nitro.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme.d.ts +2 -2
- package/lib/typescript/commonjs/theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/use-markdown-stream.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/incremental-ast.d.ts +12 -0
- package/lib/typescript/commonjs/utils/incremental-ast.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/link-security.d.ts +3 -0
- package/lib/typescript/commonjs/utils/link-security.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/stream-timeline.d.ts +11 -0
- package/lib/typescript/commonjs/utils/stream-timeline.d.ts.map +1 -0
- package/lib/typescript/module/Markdown.nitro.d.ts +5 -3
- package/lib/typescript/module/Markdown.nitro.d.ts.map +1 -1
- package/lib/typescript/module/MarkdownContext.d.ts +26 -25
- package/lib/typescript/module/MarkdownContext.d.ts.map +1 -1
- package/lib/typescript/module/headless.d.ts +15 -2
- package/lib/typescript/module/headless.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +3 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/markdown-stream.d.ts +7 -2
- package/lib/typescript/module/markdown-stream.d.ts.map +1 -1
- package/lib/typescript/module/markdown.d.ts +62 -5
- package/lib/typescript/module/markdown.d.ts.map +1 -1
- package/lib/typescript/module/renderers/blockquote.d.ts +3 -3
- package/lib/typescript/module/renderers/blockquote.d.ts.map +1 -1
- package/lib/typescript/module/renderers/code.d.ts +5 -5
- package/lib/typescript/module/renderers/code.d.ts.map +1 -1
- package/lib/typescript/module/renderers/heading.d.ts +3 -3
- package/lib/typescript/module/renderers/heading.d.ts.map +1 -1
- package/lib/typescript/module/renderers/horizontal-rule.d.ts +2 -2
- package/lib/typescript/module/renderers/horizontal-rule.d.ts.map +1 -1
- package/lib/typescript/module/renderers/image.d.ts +2 -2
- package/lib/typescript/module/renderers/image.d.ts.map +1 -1
- package/lib/typescript/module/renderers/link.d.ts +3 -3
- package/lib/typescript/module/renderers/link.d.ts.map +1 -1
- package/lib/typescript/module/renderers/list.d.ts +7 -7
- package/lib/typescript/module/renderers/list.d.ts.map +1 -1
- package/lib/typescript/module/renderers/math.d.ts +4 -4
- package/lib/typescript/module/renderers/math.d.ts.map +1 -1
- package/lib/typescript/module/renderers/paragraph.d.ts +3 -3
- package/lib/typescript/module/renderers/paragraph.d.ts.map +1 -1
- package/lib/typescript/module/renderers/table.d.ts +3 -3
- package/lib/typescript/module/renderers/table.d.ts.map +1 -1
- package/lib/typescript/module/specs/MarkdownSession.nitro.d.ts +5 -2
- package/lib/typescript/module/specs/MarkdownSession.nitro.d.ts.map +1 -1
- package/lib/typescript/module/theme.d.ts +2 -2
- package/lib/typescript/module/theme.d.ts.map +1 -1
- package/lib/typescript/module/use-markdown-stream.d.ts.map +1 -1
- package/lib/typescript/module/utils/incremental-ast.d.ts +12 -0
- package/lib/typescript/module/utils/incremental-ast.d.ts.map +1 -0
- package/lib/typescript/module/utils/link-security.d.ts +3 -0
- package/lib/typescript/module/utils/link-security.d.ts.map +1 -0
- package/lib/typescript/module/utils/stream-timeline.d.ts +11 -0
- package/lib/typescript/module/utils/stream-timeline.d.ts.map +1 -0
- package/nitrogen/generated/android/NitroMarkdownOnLoad.cpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_double_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridMarkdownSessionSpec.cpp +18 -6
- package/nitrogen/generated/android/c++/JHybridMarkdownSessionSpec.hpp +4 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/nitromarkdown/Func_void_double_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/nitromarkdown/HybridMarkdownSessionSpec.kt +11 -3
- package/nitrogen/generated/ios/NitroMarkdown-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/NitroMarkdown-Swift-Cxx-Bridge.hpp +31 -0
- package/nitrogen/generated/ios/c++/HybridMarkdownSessionSpecSwift.hpp +20 -2
- package/nitrogen/generated/ios/swift/Func_void.swift +0 -1
- package/nitrogen/generated/ios/swift/Func_void_double_double.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridMarkdownSessionSpec.swift +4 -3
- package/nitrogen/generated/ios/swift/HybridMarkdownSessionSpec_cxx.swift +34 -10
- package/nitrogen/generated/shared/c++/HybridMarkdownParserSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridMarkdownParserSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/HybridMarkdownSessionSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridMarkdownSessionSpec.hpp +4 -2
- package/package.json +7 -5
- package/src/Markdown.nitro.ts +7 -3
- package/src/MarkdownContext.ts +31 -25
- package/src/headless.ts +44 -6
- package/src/index.ts +8 -0
- package/src/markdown-stream.tsx +159 -15
- package/src/markdown.tsx +406 -50
- package/src/renderers/blockquote.tsx +4 -4
- package/src/renderers/code.tsx +16 -10
- package/src/renderers/heading.tsx +4 -4
- package/src/renderers/horizontal-rule.tsx +3 -3
- package/src/renderers/image.tsx +11 -9
- package/src/renderers/link.tsx +25 -7
- package/src/renderers/list.tsx +9 -12
- package/src/renderers/math.tsx +4 -4
- package/src/renderers/paragraph.tsx +3 -3
- package/src/renderers/table.tsx +270 -98
- package/src/specs/MarkdownSession.nitro.ts +6 -2
- package/src/theme.ts +3 -3
- package/src/use-markdown-stream.ts +22 -16
- package/src/utils/incremental-ast.ts +224 -0
- package/src/utils/link-security.ts +22 -0
- package/src/utils/stream-timeline.ts +72 -0
|
@@ -2,7 +2,7 @@ package com.margelo.nitro.com.nitromarkdown
|
|
|
2
2
|
|
|
3
3
|
class HybridMarkdownSession : HybridMarkdownSessionSpec() {
|
|
4
4
|
private var buffer = StringBuilder()
|
|
5
|
-
private val listeners = mutableMapOf<Long, () -> Unit>()
|
|
5
|
+
private val listeners = mutableMapOf<Long, (Double, Double) -> Unit>()
|
|
6
6
|
private var nextListenerId = 0L
|
|
7
7
|
private val lock = Any()
|
|
8
8
|
|
|
@@ -17,11 +17,16 @@ class HybridMarkdownSession : HybridMarkdownSessionSpec() {
|
|
|
17
17
|
override val memorySize: Long
|
|
18
18
|
get() = buffer.length.toLong()
|
|
19
19
|
|
|
20
|
-
override fun append(chunk: String) {
|
|
20
|
+
override fun append(chunk: String): Double {
|
|
21
|
+
val from: Int
|
|
22
|
+
val to: Int
|
|
21
23
|
synchronized(lock) {
|
|
24
|
+
from = buffer.length
|
|
22
25
|
buffer.append(chunk)
|
|
26
|
+
to = buffer.length
|
|
23
27
|
}
|
|
24
|
-
notifyListeners()
|
|
28
|
+
notifyListeners(from.toDouble(), to.toDouble())
|
|
29
|
+
return to.toDouble()
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
override fun clear() {
|
|
@@ -29,7 +34,7 @@ class HybridMarkdownSession : HybridMarkdownSessionSpec() {
|
|
|
29
34
|
buffer.clear()
|
|
30
35
|
highlightPosition = 0.0
|
|
31
36
|
}
|
|
32
|
-
notifyListeners()
|
|
37
|
+
notifyListeners(0.0, 0.0)
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
override fun getAllText(): String {
|
|
@@ -38,7 +43,21 @@ class HybridMarkdownSession : HybridMarkdownSessionSpec() {
|
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
override fun
|
|
46
|
+
override fun getLength(): Double {
|
|
47
|
+
synchronized(lock) {
|
|
48
|
+
return buffer.length.toDouble()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
override fun getTextRange(from: Double, to: Double): String {
|
|
53
|
+
synchronized(lock) {
|
|
54
|
+
val start = from.toInt().coerceIn(0, buffer.length)
|
|
55
|
+
val end = to.toInt().coerceIn(start, buffer.length)
|
|
56
|
+
return buffer.substring(start, end)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun addListener(listener: (Double, Double) -> Unit): () -> Unit {
|
|
42
61
|
val id: Long
|
|
43
62
|
synchronized(lock) {
|
|
44
63
|
id = nextListenerId++
|
|
@@ -51,11 +70,11 @@ class HybridMarkdownSession : HybridMarkdownSessionSpec() {
|
|
|
51
70
|
}
|
|
52
71
|
}
|
|
53
72
|
|
|
54
|
-
private fun notifyListeners() {
|
|
55
|
-
val currentListeners: Collection<() -> Unit>
|
|
73
|
+
private fun notifyListeners(from: Double, to: Double) {
|
|
74
|
+
val currentListeners: Collection<(Double, Double) -> Unit>
|
|
56
75
|
synchronized(lock) {
|
|
57
76
|
currentListeners = listeners.values.toList()
|
|
58
77
|
}
|
|
59
|
-
currentListeners.forEach { it() }
|
|
78
|
+
currentListeners.forEach { it(from, to) }
|
|
60
79
|
}
|
|
61
80
|
}
|
|
@@ -1,114 +1,264 @@
|
|
|
1
1
|
#include "HybridMarkdownParser.hpp"
|
|
2
|
-
#include <
|
|
3
|
-
#include <
|
|
2
|
+
#include <cctype>
|
|
3
|
+
#include <string>
|
|
4
4
|
|
|
5
5
|
namespace margelo::nitro::Markdown {
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
InternalParserOptions opts;
|
|
9
|
-
opts.gfm = true;
|
|
10
|
-
opts.math = true;
|
|
11
|
-
|
|
12
|
-
auto ast = parser_->parse(text, opts);
|
|
13
|
-
return nodeToJson(ast);
|
|
14
|
-
}
|
|
7
|
+
namespace {
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
internalOpts.gfm = options.gfm.value_or(true);
|
|
19
|
-
internalOpts.math = options.math.value_or(true);
|
|
20
|
-
|
|
21
|
-
auto ast = parser_->parse(text, internalOpts);
|
|
22
|
-
return nodeToJson(ast);
|
|
23
|
-
}
|
|
9
|
+
inline void appendEscapedJsonString(std::string& output, const std::string& input) {
|
|
10
|
+
static constexpr char kHex[] = "0123456789abcdef";
|
|
24
11
|
|
|
25
|
-
|
|
26
|
-
std::ostringstream o;
|
|
27
|
-
for (char c : s) {
|
|
12
|
+
for (unsigned char c : input) {
|
|
28
13
|
switch (c) {
|
|
29
|
-
case '"':
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
case '
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
case '\
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
14
|
+
case '"':
|
|
15
|
+
output += "\\\"";
|
|
16
|
+
break;
|
|
17
|
+
case '\\':
|
|
18
|
+
output += "\\\\";
|
|
19
|
+
break;
|
|
20
|
+
case '\b':
|
|
21
|
+
output += "\\b";
|
|
22
|
+
break;
|
|
23
|
+
case '\f':
|
|
24
|
+
output += "\\f";
|
|
25
|
+
break;
|
|
26
|
+
case '\n':
|
|
27
|
+
output += "\\n";
|
|
28
|
+
break;
|
|
29
|
+
case '\r':
|
|
30
|
+
output += "\\r";
|
|
31
|
+
break;
|
|
32
|
+
case '\t':
|
|
33
|
+
output += "\\t";
|
|
34
|
+
break;
|
|
35
|
+
default: {
|
|
36
|
+
if (c <= 0x1f) {
|
|
37
|
+
output += "\\u00";
|
|
38
|
+
output.push_back(kHex[(c >> 4) & 0x0f]);
|
|
39
|
+
output.push_back(kHex[c & 0x0f]);
|
|
39
40
|
} else {
|
|
40
|
-
|
|
41
|
+
output.push_back(static_cast<char>(c));
|
|
41
42
|
}
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
|
-
return o.str();
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
std::string
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
inline void appendStringField(std::string& output, const char* key, const std::string& value) {
|
|
50
|
+
output.push_back(',');
|
|
51
|
+
output.push_back('"');
|
|
52
|
+
output += key;
|
|
53
|
+
output += "\":\"";
|
|
54
|
+
appendEscapedJsonString(output, value);
|
|
55
|
+
output.push_back('"');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
inline void appendIntField(std::string& output, const char* key, int value) {
|
|
59
|
+
output.push_back(',');
|
|
60
|
+
output.push_back('"');
|
|
61
|
+
output += key;
|
|
62
|
+
output += "\":";
|
|
63
|
+
output += std::to_string(value);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
inline void appendOffsetField(std::string& output, const char* key, unsigned int value) {
|
|
67
|
+
output.push_back(',');
|
|
68
|
+
output.push_back('"');
|
|
69
|
+
output += key;
|
|
70
|
+
output += "\":";
|
|
71
|
+
output += std::to_string(value);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
inline void appendBoolField(std::string& output, const char* key, bool value) {
|
|
75
|
+
output.push_back(',');
|
|
76
|
+
output.push_back('"');
|
|
77
|
+
output += key;
|
|
78
|
+
output += "\":";
|
|
79
|
+
output += value ? "true" : "false";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
void appendNodeJson(std::string& output, const std::shared_ptr<InternalMarkdownNode>& node) {
|
|
83
|
+
output.push_back('{');
|
|
84
|
+
|
|
85
|
+
output += "\"type\":\"";
|
|
86
|
+
output += ::NitroMarkdown::nodeTypeToString(node->type);
|
|
87
|
+
output.push_back('"');
|
|
88
|
+
|
|
89
|
+
appendOffsetField(output, "beg", node->beg);
|
|
90
|
+
appendOffsetField(output, "end", node->end);
|
|
53
91
|
|
|
54
92
|
if (node->content.has_value()) {
|
|
55
|
-
|
|
93
|
+
appendStringField(output, "content", node->content.value());
|
|
56
94
|
}
|
|
57
|
-
|
|
95
|
+
|
|
58
96
|
if (node->level.has_value()) {
|
|
59
|
-
|
|
97
|
+
appendIntField(output, "level", node->level.value());
|
|
60
98
|
}
|
|
61
|
-
|
|
99
|
+
|
|
62
100
|
if (node->href.has_value()) {
|
|
63
|
-
|
|
101
|
+
appendStringField(output, "href", node->href.value());
|
|
64
102
|
}
|
|
65
|
-
|
|
103
|
+
|
|
66
104
|
if (node->title.has_value()) {
|
|
67
|
-
|
|
105
|
+
appendStringField(output, "title", node->title.value());
|
|
68
106
|
}
|
|
69
|
-
|
|
107
|
+
|
|
70
108
|
if (node->alt.has_value()) {
|
|
71
|
-
|
|
109
|
+
appendStringField(output, "alt", node->alt.value());
|
|
72
110
|
}
|
|
73
|
-
|
|
111
|
+
|
|
74
112
|
if (node->language.has_value()) {
|
|
75
|
-
|
|
113
|
+
appendStringField(output, "language", node->language.value());
|
|
76
114
|
}
|
|
77
|
-
|
|
115
|
+
|
|
78
116
|
if (node->ordered.has_value()) {
|
|
79
|
-
|
|
117
|
+
appendBoolField(output, "ordered", node->ordered.value());
|
|
80
118
|
}
|
|
81
|
-
|
|
119
|
+
|
|
82
120
|
if (node->start.has_value()) {
|
|
83
|
-
|
|
121
|
+
appendIntField(output, "start", node->start.value());
|
|
84
122
|
}
|
|
85
|
-
|
|
123
|
+
|
|
86
124
|
if (node->checked.has_value()) {
|
|
87
|
-
|
|
125
|
+
appendBoolField(output, "checked", node->checked.value());
|
|
88
126
|
}
|
|
89
|
-
|
|
127
|
+
|
|
90
128
|
if (node->isHeader.has_value()) {
|
|
91
|
-
|
|
129
|
+
appendBoolField(output, "isHeader", node->isHeader.value());
|
|
92
130
|
}
|
|
93
|
-
|
|
131
|
+
|
|
94
132
|
if (node->align.has_value()) {
|
|
95
133
|
std::string alignStr = ::NitroMarkdown::textAlignToString(node->align.value());
|
|
96
134
|
if (!alignStr.empty()) {
|
|
97
|
-
|
|
135
|
+
appendStringField(output, "align", alignStr);
|
|
98
136
|
}
|
|
99
137
|
}
|
|
100
138
|
|
|
101
139
|
if (!node->children.empty()) {
|
|
102
|
-
|
|
140
|
+
output += ",\"children\":[";
|
|
103
141
|
for (size_t i = 0; i < node->children.size(); ++i) {
|
|
104
|
-
if (i > 0)
|
|
105
|
-
|
|
142
|
+
if (i > 0) {
|
|
143
|
+
output.push_back(',');
|
|
144
|
+
}
|
|
145
|
+
appendNodeJson(output, node->children[i]);
|
|
106
146
|
}
|
|
107
|
-
|
|
147
|
+
output.push_back(']');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
output.push_back('}');
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
std::string trimCopy(const std::string& input) {
|
|
154
|
+
size_t start = 0;
|
|
155
|
+
while (start < input.size() && std::isspace(static_cast<unsigned char>(input[start]))) {
|
|
156
|
+
start++;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
size_t end = input.size();
|
|
160
|
+
while (end > start && std::isspace(static_cast<unsigned char>(input[end - 1]))) {
|
|
161
|
+
end--;
|
|
108
162
|
}
|
|
163
|
+
|
|
164
|
+
return input.substr(start, end - start);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
std::string flattenNodeText(const std::shared_ptr<InternalMarkdownNode>& node) {
|
|
168
|
+
using ::NitroMarkdown::NodeType;
|
|
169
|
+
|
|
170
|
+
if (!node) return "";
|
|
171
|
+
|
|
172
|
+
switch (node->type) {
|
|
173
|
+
case NodeType::Text:
|
|
174
|
+
case NodeType::CodeInline:
|
|
175
|
+
case NodeType::MathInline:
|
|
176
|
+
case NodeType::HtmlInline:
|
|
177
|
+
return node->content.value_or("");
|
|
178
|
+
case NodeType::CodeBlock:
|
|
179
|
+
case NodeType::MathBlock:
|
|
180
|
+
case NodeType::HtmlBlock:
|
|
181
|
+
return trimCopy(node->content.value_or("")) + "\n\n";
|
|
182
|
+
case NodeType::LineBreak:
|
|
183
|
+
return "\n";
|
|
184
|
+
case NodeType::SoftBreak:
|
|
185
|
+
return " ";
|
|
186
|
+
case NodeType::HorizontalRule:
|
|
187
|
+
return "---\n\n";
|
|
188
|
+
case NodeType::Image:
|
|
189
|
+
return node->alt.value_or(node->title.value_or(""));
|
|
190
|
+
default:
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
std::string childrenText;
|
|
195
|
+
childrenText.reserve(128);
|
|
196
|
+
for (const auto& child : node->children) {
|
|
197
|
+
childrenText += flattenNodeText(child);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
switch (node->type) {
|
|
201
|
+
case NodeType::Paragraph:
|
|
202
|
+
case NodeType::Heading:
|
|
203
|
+
case NodeType::Blockquote:
|
|
204
|
+
return trimCopy(childrenText) + "\n\n";
|
|
205
|
+
case NodeType::ListItem:
|
|
206
|
+
case NodeType::TaskListItem:
|
|
207
|
+
return trimCopy(childrenText) + "\n";
|
|
208
|
+
case NodeType::List:
|
|
209
|
+
return childrenText + "\n";
|
|
210
|
+
case NodeType::TableRow:
|
|
211
|
+
return childrenText + "\n";
|
|
212
|
+
case NodeType::TableCell:
|
|
213
|
+
return childrenText + " | ";
|
|
214
|
+
default:
|
|
215
|
+
return childrenText;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
} // namespace
|
|
220
|
+
|
|
221
|
+
std::string HybridMarkdownParser::parse(const std::string& text) {
|
|
222
|
+
InternalParserOptions opts;
|
|
223
|
+
opts.gfm = true;
|
|
224
|
+
opts.math = true;
|
|
109
225
|
|
|
110
|
-
|
|
111
|
-
return
|
|
226
|
+
auto ast = parser_->parse(text, opts);
|
|
227
|
+
return nodeToJson(ast);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
std::string HybridMarkdownParser::parseWithOptions(const std::string& text, const ParserOptions& options) {
|
|
231
|
+
InternalParserOptions internalOpts;
|
|
232
|
+
internalOpts.gfm = options.gfm.value_or(true);
|
|
233
|
+
internalOpts.math = options.math.value_or(true);
|
|
234
|
+
|
|
235
|
+
auto ast = parser_->parse(text, internalOpts);
|
|
236
|
+
return nodeToJson(ast);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
std::string HybridMarkdownParser::extractPlainText(const std::string& text) {
|
|
240
|
+
InternalParserOptions opts;
|
|
241
|
+
opts.gfm = true;
|
|
242
|
+
opts.math = true;
|
|
243
|
+
|
|
244
|
+
auto ast = parser_->parse(text, opts);
|
|
245
|
+
return flattenNodeText(ast);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
std::string HybridMarkdownParser::extractPlainTextWithOptions(const std::string& text, const ParserOptions& options) {
|
|
249
|
+
InternalParserOptions internalOpts;
|
|
250
|
+
internalOpts.gfm = options.gfm.value_or(true);
|
|
251
|
+
internalOpts.math = options.math.value_or(true);
|
|
252
|
+
|
|
253
|
+
auto ast = parser_->parse(text, internalOpts);
|
|
254
|
+
return flattenNodeText(ast);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
std::string HybridMarkdownParser::nodeToJson(const std::shared_ptr<InternalMarkdownNode>& node) {
|
|
258
|
+
std::string json;
|
|
259
|
+
json.reserve(1024);
|
|
260
|
+
appendNodeJson(json, node);
|
|
261
|
+
return json;
|
|
112
262
|
}
|
|
113
263
|
|
|
114
264
|
} // namespace margelo::nitro::Markdown
|
|
@@ -19,6 +19,8 @@ public:
|
|
|
19
19
|
|
|
20
20
|
std::string parse(const std::string& text) override;
|
|
21
21
|
std::string parseWithOptions(const std::string& text, const ParserOptions& options) override;
|
|
22
|
+
std::string extractPlainText(const std::string& text) override;
|
|
23
|
+
std::string extractPlainTextWithOptions(const std::string& text, const ParserOptions& options) override;
|
|
22
24
|
|
|
23
25
|
private:
|
|
24
26
|
std::unique_ptr<::NitroMarkdown::MD4CParser> parser_;
|
|
@@ -3,7 +3,7 @@ import NitroModules
|
|
|
3
3
|
|
|
4
4
|
class HybridMarkdownSession: HybridMarkdownSessionSpec {
|
|
5
5
|
private var buffer = ""
|
|
6
|
-
private var listeners: [UUID: () -> Void] = [:]
|
|
6
|
+
private var listeners: [UUID: (Double, Double) -> Void] = [:]
|
|
7
7
|
private let lock = NSLock()
|
|
8
8
|
|
|
9
9
|
private(set) var version: Int = 0
|
|
@@ -15,13 +15,22 @@ class HybridMarkdownSession: HybridMarkdownSessionSpec {
|
|
|
15
15
|
var memorySize: Int {
|
|
16
16
|
return buffer.utf8.count + MemoryLayout<HybridMarkdownSession>.size
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
private func utf16Length(_ value: String) -> Int {
|
|
20
|
+
return (value as NSString).length
|
|
21
|
+
}
|
|
18
22
|
|
|
19
|
-
func append(chunk: String) throws {
|
|
23
|
+
func append(chunk: String) throws -> Double {
|
|
24
|
+
let from: Int
|
|
25
|
+
let to: Int
|
|
20
26
|
lock.lock()
|
|
27
|
+
from = utf16Length(buffer)
|
|
21
28
|
buffer += chunk
|
|
29
|
+
to = utf16Length(buffer)
|
|
22
30
|
version += 1
|
|
23
31
|
lock.unlock()
|
|
24
|
-
notifyListeners()
|
|
32
|
+
notifyListeners(from: Double(from), to: Double(to))
|
|
33
|
+
return Double(to)
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
func clear() throws {
|
|
@@ -30,7 +39,7 @@ class HybridMarkdownSession: HybridMarkdownSessionSpec {
|
|
|
30
39
|
highlightPosition = 0
|
|
31
40
|
version += 1
|
|
32
41
|
lock.unlock()
|
|
33
|
-
notifyListeners()
|
|
42
|
+
notifyListeners(from: 0, to: 0)
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
func getAllText() throws -> String {
|
|
@@ -38,8 +47,25 @@ class HybridMarkdownSession: HybridMarkdownSessionSpec {
|
|
|
38
47
|
defer { lock.unlock() }
|
|
39
48
|
return buffer
|
|
40
49
|
}
|
|
50
|
+
|
|
51
|
+
func getLength() throws -> Double {
|
|
52
|
+
lock.lock()
|
|
53
|
+
defer { lock.unlock() }
|
|
54
|
+
return Double(utf16Length(buffer))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
func getTextRange(from: Double, to: Double) throws -> String {
|
|
58
|
+
lock.lock()
|
|
59
|
+
defer { lock.unlock() }
|
|
60
|
+
|
|
61
|
+
let text = buffer as NSString
|
|
62
|
+
let length = text.length
|
|
63
|
+
let start = max(0, min(Int(from), length))
|
|
64
|
+
let end = max(start, min(Int(to), length))
|
|
65
|
+
return text.substring(with: NSRange(location: start, length: end - start))
|
|
66
|
+
}
|
|
41
67
|
|
|
42
|
-
func addListener(listener: @escaping () -> Void) throws -> () -> Void {
|
|
68
|
+
func addListener(listener: @escaping (Double, Double) -> Void) throws -> () -> Void {
|
|
43
69
|
let id = UUID()
|
|
44
70
|
lock.lock()
|
|
45
71
|
listeners[id] = listener
|
|
@@ -52,13 +78,13 @@ class HybridMarkdownSession: HybridMarkdownSessionSpec {
|
|
|
52
78
|
}
|
|
53
79
|
}
|
|
54
80
|
|
|
55
|
-
private func notifyListeners() {
|
|
81
|
+
private func notifyListeners(from: Double, to: Double) {
|
|
56
82
|
lock.lock()
|
|
57
83
|
let currentListeners = Array(listeners.values)
|
|
58
84
|
lock.unlock()
|
|
59
85
|
|
|
60
86
|
for listener in currentListeners {
|
|
61
|
-
listener()
|
|
87
|
+
listener(from, to)
|
|
62
88
|
}
|
|
63
89
|
}
|
|
64
90
|
}
|
|
@@ -10,7 +10,8 @@ const MarkdownContext = exports.MarkdownContext = /*#__PURE__*/(0, _react.create
|
|
|
10
10
|
renderers: {},
|
|
11
11
|
theme: _theme.defaultMarkdownTheme,
|
|
12
12
|
styles: undefined,
|
|
13
|
-
stylingStrategy: "opinionated"
|
|
13
|
+
stylingStrategy: "opinionated",
|
|
14
|
+
onLinkPress: undefined
|
|
14
15
|
});
|
|
15
16
|
const useMarkdownContext = () => (0, _react.useContext)(MarkdownContext);
|
|
16
17
|
exports.useMarkdownContext = useMarkdownContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_theme","MarkdownContext","exports","createContext","renderers","theme","defaultMarkdownTheme","styles","undefined","stylingStrategy","useMarkdownContext","useContext"],"sourceRoot":"../../src","sources":["MarkdownContext.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","require","_theme","MarkdownContext","exports","createContext","renderers","theme","defaultMarkdownTheme","styles","undefined","stylingStrategy","onLinkPress","useMarkdownContext","useContext"],"sourceRoot":"../../src","sources":["MarkdownContext.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AAwFO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAG,IAAAE,oBAAa,EAAuB;EACjEC,SAAS,EAAE,CAAC,CAAC;EACbC,KAAK,EAAEC,2BAAoB;EAC3BC,MAAM,EAAEC,SAAS;EACjBC,eAAe,EAAE,aAAa;EAC9BC,WAAW,EAAEF;AACf,CAAC,CAAC;AAEK,MAAMG,kBAAkB,GAAGA,CAAA,KAAM,IAAAC,iBAAU,EAACX,eAAe,CAAC;AAACC,OAAA,CAAAS,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/lib/commonjs/headless.js
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.MarkdownParserModule = void 0;
|
|
7
|
+
exports.extractPlainText = extractPlainText;
|
|
8
|
+
exports.extractPlainTextWithOptions = extractPlainTextWithOptions;
|
|
9
|
+
exports.getTextContent = exports.getFlattenedText = void 0;
|
|
7
10
|
exports.parseMarkdown = parseMarkdown;
|
|
8
11
|
exports.parseMarkdownWithOptions = parseMarkdownWithOptions;
|
|
9
12
|
var _reactNativeNitroModules = require("react-native-nitro-modules");
|
|
@@ -33,8 +36,14 @@ const MarkdownParserModule = exports.MarkdownParserModule = _reactNativeNitroMod
|
|
|
33
36
|
* @returns The root node of the parsed AST
|
|
34
37
|
*/
|
|
35
38
|
function parseMarkdown(text) {
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
if (typeof MarkdownParserModule.parse === "function") {
|
|
40
|
+
const jsonStr = MarkdownParserModule.parse(text);
|
|
41
|
+
return JSON.parse(jsonStr);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
type: "document",
|
|
45
|
+
children: []
|
|
46
|
+
};
|
|
38
47
|
}
|
|
39
48
|
|
|
40
49
|
/**
|
|
@@ -44,8 +53,35 @@ function parseMarkdown(text) {
|
|
|
44
53
|
* @returns The root node of the parsed AST
|
|
45
54
|
*/
|
|
46
55
|
function parseMarkdownWithOptions(text, options) {
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
if (typeof MarkdownParserModule.parseWithOptions === "function") {
|
|
57
|
+
const jsonStr = MarkdownParserModule.parseWithOptions(text, options);
|
|
58
|
+
return JSON.parse(jsonStr);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
type: "document",
|
|
62
|
+
children: []
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Parse markdown and return flattened plain text directly from native parser.
|
|
68
|
+
* Useful for search/indexing flows that don't need full AST rendering.
|
|
69
|
+
*/
|
|
70
|
+
function extractPlainText(text) {
|
|
71
|
+
if (typeof MarkdownParserModule.extractPlainText === "function") {
|
|
72
|
+
return MarkdownParserModule.extractPlainText(text);
|
|
73
|
+
}
|
|
74
|
+
return getFlattenedText(parseMarkdown(text));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Parse markdown with options and return flattened plain text from native parser.
|
|
79
|
+
*/
|
|
80
|
+
function extractPlainTextWithOptions(text, options) {
|
|
81
|
+
if (typeof MarkdownParserModule.extractPlainTextWithOptions === "function") {
|
|
82
|
+
return MarkdownParserModule.extractPlainTextWithOptions(text, options);
|
|
83
|
+
}
|
|
84
|
+
return getFlattenedText(parseMarkdownWithOptions(text, options));
|
|
49
85
|
}
|
|
50
86
|
/**
|
|
51
87
|
* Extract text content from a markdown node recursively.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeNitroModules","require","MarkdownParserModule","exports","NitroModules","createHybridObject","parseMarkdown","text","
|
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","MarkdownParserModule","exports","NitroModules","createHybridObject","parseMarkdown","text","parse","jsonStr","JSON","type","children","parseMarkdownWithOptions","options","parseWithOptions","extractPlainText","getFlattenedText","extractPlainTextWithOptions","getTextContent","node","content","map","join","trim","alt","title","childrenText"],"sourceRoot":"../../src","sources":["headless.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_headless","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_markdown","_markdownStream","_MarkdownContext","_theme","_heading","_paragraph","_link","_blockquote","_horizontalRule","_code","_list","_table","_image","_math","_MarkdownSession","_useMarkdownStream"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAS,SAAA,GAAAb,OAAA;
|
|
1
|
+
{"version":3,"names":["_headless","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_markdown","_markdownStream","_MarkdownContext","_theme","_heading","_paragraph","_link","_blockquote","_horizontalRule","_code","_list","_table","_image","_math","_MarkdownSession","_useMarkdownStream"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAS,SAAA,GAAAb,OAAA;AAOA,IAAAc,eAAA,GAAAd,OAAA;AAGA,IAAAe,gBAAA,GAAAf,OAAA;AAmBA,IAAAgB,MAAA,GAAAhB,OAAA;AAYA,IAAAiB,QAAA,GAAAjB,OAAA;AACA,IAAAkB,UAAA,GAAAlB,OAAA;AACA,IAAAmB,KAAA,GAAAnB,OAAA;AACA,IAAAoB,WAAA,GAAApB,OAAA;AACA,IAAAqB,eAAA,GAAArB,OAAA;AACA,IAAAsB,KAAA,GAAAtB,OAAA;AACA,IAAAuB,KAAA,GAAAvB,OAAA;AACA,IAAAwB,MAAA,GAAAxB,OAAA;AACA,IAAAyB,MAAA,GAAAzB,OAAA;AACA,IAAA0B,KAAA,GAAA1B,OAAA;AAEA,IAAA2B,gBAAA,GAAA3B,OAAA;AAEA,IAAA4B,kBAAA,GAAA5B,OAAA","ignoreList":[]}
|