highmark-yapp 1.0.7 → 1.0.9

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.
@@ -6,25 +6,23 @@ import MarkdownParser from "../markdown/parser";
6
6
  const markdownLexer = MarkdownLexer.fromNothing(),
7
7
  markdownParser = MarkdownParser.fromNothing();
8
8
 
9
- export function nodeFromContent(content) {
9
+ export function tokensFromContent(content) {
10
10
  const lexer = markdownLexer, ///
11
- parser = markdownParser, ///
12
- tokens = lexer.tokenise(content),
11
+ tokens = lexer.tokenise(content);
12
+
13
+ return tokens;
14
+ }
15
+
16
+ export function nodeFromTokens(tokens) {
17
+ const parser = markdownParser, ///
13
18
  startRule = parser.getStartRule(),
14
19
  startOfContent = true,
15
20
  node = parser.parse(tokens, startRule, startOfContent);
16
21
 
17
- if (node !== null) {
18
- const context = {
19
- tokens
20
- };
21
-
22
- node.createDOMElement(context);
23
- }
24
-
25
22
  return node;
26
23
  }
27
24
 
28
25
  export default {
29
- nodeFromContent
26
+ tokensFromContent,
27
+ nodeFromTokens
30
28
  };