highmark-markdown 1.1.8 → 1.1.10
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 +31 -25
- package/lib/node/css.js +6 -6
- package/lib/node/html/division.js +2 -2
- package/lib/node/html/item/contents.js +2 -2
- package/lib/node/html/item/footnote.js +3 -3
- package/lib/node/html/item/index.js +6 -6
- package/lib/node/html/link/contents.js +3 -3
- package/lib/node/html/list/contents.js +2 -2
- package/lib/node/html/list/footnotes.js +2 -2
- package/lib/node/html/list/index.js +2 -2
- package/lib/node/html/topmost.js +7 -1
- package/lib/node/html.js +6 -6
- package/package.json +1 -1
- package/src/node/css.js +5 -4
- package/src/node/html/division.js +2 -2
- package/src/node/html/item/contents.js +2 -2
- package/src/node/html/item/footnote.js +2 -2
- package/src/node/html/item/index.js +5 -5
- package/src/node/html/link/contents.js +2 -2
- package/src/node/html/list/contents.js +2 -2
- package/src/node/html/list/footnotes.js +2 -2
- package/src/node/html/list/index.js +2 -2
- package/src/node/html/topmost.js +2 -0
- package/src/node/html.js +5 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "highmark-markdown",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.10",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/highmark-markdown",
|
|
7
7
|
"description": "Highmark's Markdown and Markdown Style languages.",
|
package/src/node/css.js
CHANGED
|
@@ -81,14 +81,15 @@ class CSSNode extends Node {
|
|
|
81
81
|
return node;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
static
|
|
85
|
-
if (
|
|
86
|
-
|
|
84
|
+
static fromChildCSSNodes(Class, childCssNodes, ...remainingArguments) {
|
|
85
|
+
if (childCssNodes === undefined) {
|
|
86
|
+
childCssNodes = Class; ///
|
|
87
87
|
|
|
88
88
|
Class = CSSNode; ///
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
const
|
|
91
|
+
const childNodes = childCssNodes, ///
|
|
92
|
+
node = Node.fromChildNodes(Class, childNodes, ...remainingArguments);
|
|
92
93
|
|
|
93
94
|
return node;
|
|
94
95
|
}
|
|
@@ -172,8 +172,8 @@ export default class DivisionHTMLNode extends HTMLNode {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
static fromPaginatedHTMLNodesAndDivisionClassName(paginatedHTMLNodes, divisionClassName) {
|
|
175
|
-
const
|
|
176
|
-
divisionHTMLNode = HTMLNode.
|
|
175
|
+
const childHTMLNodes = paginatedHTMLNodes, ///
|
|
176
|
+
divisionHTMLNode = HTMLNode.fromChildHTMLNodes(DivisionHTMLNode, childHTMLNodes, divisionClassName);
|
|
177
177
|
|
|
178
178
|
return divisionHTMLNode;
|
|
179
179
|
}
|
|
@@ -28,8 +28,8 @@ export default class ContentsItemHTMLNode extends HTMLNode {
|
|
|
28
28
|
|
|
29
29
|
return htmlNode;
|
|
30
30
|
}),
|
|
31
|
-
|
|
32
|
-
contentsItemHTMLNode = HTMLNode.
|
|
31
|
+
childHTMLNodes = htmlNodes, ///
|
|
32
|
+
contentsItemHTMLNode = HTMLNode.fromChildHTMLNodes(ContentsItemHTMLNode, childHTMLNodes);
|
|
33
33
|
|
|
34
34
|
return contentsItemHTMLNode;
|
|
35
35
|
}
|
|
@@ -28,11 +28,11 @@ export default class FootnoteItemHTMLNode extends HTMLNode {
|
|
|
28
28
|
const prepend = FOOTNOTE_PREPEND,
|
|
29
29
|
anchorHTMLNode = AnchorHTMLNode.fromPrependAndIdentifier(prepend, identifier),
|
|
30
30
|
lineHTMLNode = lineHTMLTransform.getLineHTMLNode(),
|
|
31
|
-
|
|
31
|
+
childHTMLNodes = [
|
|
32
32
|
anchorHTMLNode,
|
|
33
33
|
lineHTMLNode
|
|
34
34
|
],
|
|
35
|
-
footnoteItemHTMLNode = HTMLNode.
|
|
35
|
+
footnoteItemHTMLNode = HTMLNode.fromChildHTMLNodes(FootnoteItemHTMLNode, childHTMLNodes);
|
|
36
36
|
|
|
37
37
|
return footnoteItemHTMLNode;
|
|
38
38
|
}
|
|
@@ -29,23 +29,23 @@ export default class IndexItemHTMLNode extends HTMLNode {
|
|
|
29
29
|
const wordOrPhrase = indexItem.getWordOrPhrase(),
|
|
30
30
|
pageNumbers = indexItem.getPageNumbers(),
|
|
31
31
|
indexSpanHTMLNode = IndexTextHTMLNode.fromWordOrPhrase(wordOrPhrase),
|
|
32
|
-
|
|
32
|
+
childNHTMLodes = [
|
|
33
33
|
indexSpanHTMLNode
|
|
34
34
|
];
|
|
35
35
|
|
|
36
36
|
pageNumbers.forEach((pageNumber) => {
|
|
37
37
|
const indexLinkHTMLNOde = IndexLinkHTMLNode.fromPageNumber(pageNumber);
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
childNHTMLodes.push(indexLinkHTMLNOde);
|
|
40
40
|
|
|
41
41
|
const commaTextHTMLNode = CommaTextHTMLNode.fromNothing();
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
childNHTMLodes.push(commaTextHTMLNode);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
childNHTMLodes.pop();
|
|
47
47
|
|
|
48
|
-
const indexItemHTMLNode = HTMLNode.
|
|
48
|
+
const indexItemHTMLNode = HTMLNode.fromChildHTMLNodes(IndexItemHTMLNode, childNHTMLodes);
|
|
49
49
|
|
|
50
50
|
return indexItemHTMLNode;
|
|
51
51
|
}
|
|
@@ -49,10 +49,10 @@ export default class ContentsLinkHTMLNode extends HTMLNode {
|
|
|
49
49
|
|
|
50
50
|
static fromLineHTMLTransformAndIdentifier(lineHTMLTransform, identifier) {
|
|
51
51
|
const lineHTMLNode = lineHTMLTransform.getLineHTMLNode(),
|
|
52
|
-
|
|
52
|
+
childHTMLNodes = [
|
|
53
53
|
lineHTMLNode
|
|
54
54
|
],
|
|
55
|
-
contentsLinkHTMLNode = HTMLNode.
|
|
55
|
+
contentsLinkHTMLNode = HTMLNode.fromChildHTMLNodes(ContentsLinkHTMLNode, childHTMLNodes, identifier);
|
|
56
56
|
|
|
57
57
|
return contentsLinkHTMLNode;
|
|
58
58
|
}
|
|
@@ -28,8 +28,8 @@ export default class ContentsListHTMLNode extends HTMLNode {
|
|
|
28
28
|
|
|
29
29
|
return contentsItemHTMLNode;
|
|
30
30
|
}),
|
|
31
|
-
|
|
32
|
-
contentsListHTMLNode = HTMLNode.
|
|
31
|
+
childHTMLNodes = contentsItemHTMLNodes, ///
|
|
32
|
+
contentsListHTMLNode = HTMLNode.fromChildHTMLNodes(ContentsListHTMLNode, childHTMLNodes);
|
|
33
33
|
|
|
34
34
|
return contentsListHTMLNode;
|
|
35
35
|
}
|
|
@@ -51,8 +51,8 @@ export default class FootnotesListHTMLNode extends HTMLNode {
|
|
|
51
51
|
|
|
52
52
|
return footnoteItemHTMLNode;
|
|
53
53
|
}),
|
|
54
|
-
|
|
55
|
-
footnotesListHTMLNode = HTMLNode.
|
|
54
|
+
childNHTMLodes = footnoteItemHTMLNodes, ///
|
|
55
|
+
footnotesListHTMLNode = HTMLNode.fromChildHTMLNodes(FootnotesListHTMLNode, childNHTMLodes, start);
|
|
56
56
|
|
|
57
57
|
return footnotesListHTMLNode;
|
|
58
58
|
}
|
|
@@ -28,8 +28,8 @@ export default class IndexListHTMLNode extends HTMLNode {
|
|
|
28
28
|
|
|
29
29
|
return indexListHTMLNode;
|
|
30
30
|
}),
|
|
31
|
-
|
|
32
|
-
indexListHTMLNode = HTMLNode.
|
|
31
|
+
childHTMLNodes = indexItemHTMLNodes,
|
|
32
|
+
indexListHTMLNode = HTMLNode.fromChildHTMLNodes(IndexListHTMLNode, childHTMLNodes);
|
|
33
33
|
|
|
34
34
|
return indexListHTMLNode;
|
|
35
35
|
}
|
package/src/node/html/topmost.js
CHANGED
|
@@ -131,6 +131,8 @@ export default class TopmostHTMLNode extends HTMLNode {
|
|
|
131
131
|
static className = null;
|
|
132
132
|
|
|
133
133
|
static fromNothing() { return HTMLNode.fromNothing(TopmostHTMLNode); }
|
|
134
|
+
|
|
135
|
+
static fromChildHTMLNodes(childHTMLNodes) { return HTMLNode.fromChildHTMLNodes(TopmostHTMLNode, childHTMLNodes); }
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
function divisionHTMLTransformsFromDivisionHTMLNodes(divisionHTMLNodes) {
|
package/src/node/html.js
CHANGED
|
@@ -390,14 +390,15 @@ ${childNodePlainText}`;
|
|
|
390
390
|
return node;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
static
|
|
394
|
-
if (
|
|
395
|
-
|
|
393
|
+
static fromChildHTMLNodes(Class, childHTMLNodes, ...remainingArguments) {
|
|
394
|
+
if (childHTMLNodes === undefined) {
|
|
395
|
+
childHTMLNodes = Class; ///
|
|
396
396
|
|
|
397
397
|
Class = HTMLNode; ///
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
const
|
|
400
|
+
const childNodes = childHTMLNodes, ///
|
|
401
|
+
domElement = null,
|
|
401
402
|
node = Node.fromChildNodes(Class, childNodes, domElement, ...remainingArguments);
|
|
402
403
|
|
|
403
404
|
return node;
|