mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-26 02:05:31 +00:00
Copy react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67 (upstream software-mansion/enriched-markdown 766fc0e67) into packages/react-native-enriched-markdown, with patches/react-native-enriched-markdown+1.2.0-nightly-20261014-766fc0e67.patch applied. Nothing else changes in this commit; the package is not a workspace yet. Reproduce: npm pack react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67 tar xzf react-native-enriched-markdown-*.tgz mkdir -p t/node_modules && mv package t/node_modules/react-native-enriched-markdown (cd t && git init -q && git apply ../patches/react-native-enriched-markdown+*.patch) diff -r t/node_modules/react-native-enriched-markdown packages/react-native-enriched-markdown The diff is empty.
68 lines
1.2 KiB
C++
68 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
|
|
namespace Markdown {
|
|
|
|
enum class NodeType {
|
|
Document,
|
|
Paragraph,
|
|
Text,
|
|
Link,
|
|
Heading,
|
|
LineBreak,
|
|
Strong,
|
|
Emphasis,
|
|
Strikethrough,
|
|
Underline,
|
|
Code,
|
|
Image,
|
|
Blockquote,
|
|
UnorderedList,
|
|
OrderedList,
|
|
ListItem,
|
|
CodeBlock,
|
|
ThematicBreak,
|
|
Table,
|
|
TableHead,
|
|
TableBody,
|
|
TableRow,
|
|
TableHeaderCell,
|
|
TableCell,
|
|
LatexMathInline,
|
|
LatexMathDisplay,
|
|
Spoiler,
|
|
Superscript,
|
|
Subscript,
|
|
Highlight,
|
|
SoftBreak,
|
|
BlankLine,
|
|
Admonition,
|
|
Video
|
|
};
|
|
|
|
struct MarkdownASTNode {
|
|
NodeType type;
|
|
std::string content;
|
|
std::unordered_map<std::string, std::string> attributes;
|
|
std::vector<std::shared_ptr<MarkdownASTNode>> children;
|
|
|
|
explicit MarkdownASTNode(NodeType t) : type(t) {}
|
|
|
|
void addChild(std::shared_ptr<MarkdownASTNode> child) {
|
|
if (child) {
|
|
children.push_back(std::move(child));
|
|
}
|
|
}
|
|
|
|
void setAttribute(const std::string& key, const std::string& value) {
|
|
attributes[key] = value;
|
|
}
|
|
};
|
|
|
|
} // namespace Markdown
|
|
|