highmark-markdown 0.0.362 → 0.0.364
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/example.js +28 -43
- package/lib/markdown/bnf.js +2 -2
- package/lib/node/markdown/directive/contents.js +2 -17
- package/lib/node/markdown/division.js +4 -4
- package/lib/node/markdown/heading/primary.js +2 -2
- package/lib/node/markdown/heading/quaternary.js +2 -2
- package/lib/node/markdown/heading/secondary.js +2 -2
- package/lib/node/markdown/heading/tertiary.js +2 -2
- package/lib/node/markdown/heading.js +5 -5
- package/lib/utilities/contents.js +15 -15
- package/package.json +1 -1
- package/src/markdown/bnf.js +1 -1
- package/src/node/markdown/directive/contents.js +0 -21
- package/src/node/markdown/division.js +4 -4
- package/src/node/markdown/heading/primary.js +1 -1
- package/src/node/markdown/heading/quaternary.js +1 -1
- package/src/node/markdown/heading/secondary.js +1 -1
- package/src/node/markdown/heading/tertiary.js +1 -1
- package/src/node/markdown/heading.js +3 -3
- package/src/utilities/contents.js +13 -13
|
@@ -8,16 +8,16 @@ export function nestNodes(nodes) {
|
|
|
8
8
|
const nestedNodesStack = NestedNodeStack.fromNothing();
|
|
9
9
|
|
|
10
10
|
nodes.forEach((node) => {
|
|
11
|
-
const
|
|
11
|
+
const depth = node.getDepth();
|
|
12
12
|
|
|
13
|
-
let
|
|
13
|
+
let nestedNodesStackDepth = nestedNodesStack.getDepth()
|
|
14
14
|
|
|
15
|
-
while (
|
|
16
|
-
|
|
15
|
+
while (nestedNodesStackDepth < depth) {
|
|
16
|
+
nestedNodesStackDepth = nestedNodesStack.increment();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
while (
|
|
20
|
-
|
|
19
|
+
while (nestedNodesStackDepth > depth) {
|
|
20
|
+
nestedNodesStackDepth = nestedNodesStack.decrement();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const nestedNode = NestedNode.fromNode(node);
|
|
@@ -88,11 +88,11 @@ class NestedNodeStack {
|
|
|
88
88
|
return nestedNode;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
getDepth() {
|
|
92
92
|
const nestedNodesLength = this.nestedNodes.length,
|
|
93
|
-
|
|
93
|
+
depth = nestedNodesLength; ///
|
|
94
94
|
|
|
95
|
-
return
|
|
95
|
+
return depth;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
increment() {
|
|
@@ -100,17 +100,17 @@ class NestedNodeStack {
|
|
|
100
100
|
|
|
101
101
|
this.addNestedNode(nestedNode);
|
|
102
102
|
|
|
103
|
-
const
|
|
103
|
+
const depth = this.getDepth();
|
|
104
104
|
|
|
105
|
-
return
|
|
105
|
+
return depth;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
decrement() {
|
|
109
109
|
this.removeNestedNode();
|
|
110
110
|
|
|
111
|
-
const
|
|
111
|
+
const depth = this.getDepth();
|
|
112
112
|
|
|
113
|
-
return
|
|
113
|
+
return depth;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
addNestedNode(nestedNode) {
|