highmark-markdown 1.0.24 → 1.0.26
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 +57 -55
- package/lib/markdown/bnf.js +2 -2
- package/lib/node/markdown/blockLine.js +3 -4
- package/lib/node/markdown/emailLink.js +1 -17
- package/lib/node/markdown/endOfLine.js +12 -5
- package/lib/node/markdown/error.js +2 -2
- package/lib/node/markdown/hyperlink.js +1 -17
- package/lib/node/markdown/line.js +13 -13
- package/lib/node/markdown/verticalSpace.js +31 -3
- package/package.json +1 -1
- package/src/markdown/bnf.js +1 -1
- package/src/node/markdown/blockLine.js +3 -4
- package/src/node/markdown/emailLink.js +0 -14
- package/src/node/markdown/endOfLine.js +11 -4
- package/src/node/markdown/error.js +1 -1
- package/src/node/markdown/hyperlink.js +0 -14
- package/src/node/markdown/line.js +19 -17
- package/src/node/markdown/verticalSpace.js +18 -2
|
@@ -63,20 +63,6 @@ class HyperlinkLinkMarkdownNode extends MarkdownNode {
|
|
|
63
63
|
return attributeValue;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
mount(parentDOMElement, siblingDOMElement, context) {
|
|
67
|
-
this.domElement = this.createDOMElement(context);
|
|
68
|
-
|
|
69
|
-
parentDOMElement.insertBefore(this.domElement, siblingDOMElement);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
unmount(parentDOMElement, context) {
|
|
73
|
-
if (this.domElement !== null) {
|
|
74
|
-
parentDOMElement.removeChild(this.domElement);
|
|
75
|
-
|
|
76
|
-
this.domElement = null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
66
|
createDOMElement(context) {
|
|
81
67
|
let content;
|
|
82
68
|
|
|
@@ -15,19 +15,6 @@ export default class LineMarkdownNode extends MarkdownNode {
|
|
|
15
15
|
return lines;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
asHTML(indent, context) {
|
|
19
|
-
indent = this.adjustIndent(indent);
|
|
20
|
-
|
|
21
|
-
const childNodesHTML = this.childNodesAsHTML(indent, context),
|
|
22
|
-
startingTag = this.startingTag(context),
|
|
23
|
-
closingTag = this.closingTag(context),
|
|
24
|
-
html = (indent !== null) ?
|
|
25
|
-
`${indent}${startingTag}${childNodesHTML}${closingTag}
|
|
26
|
-
`: `${startingTag}${childNodesHTML}${closingTag}`;
|
|
27
|
-
|
|
28
|
-
return html;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
18
|
mount(parentDOMElement, siblingDOMElement, context) {
|
|
32
19
|
this.domElement = this.createDOMElement(context);
|
|
33
20
|
|
|
@@ -58,18 +45,33 @@ export default class LineMarkdownNode extends MarkdownNode {
|
|
|
58
45
|
return domElement;
|
|
59
46
|
}
|
|
60
47
|
|
|
48
|
+
asHTML(indent, context) {
|
|
49
|
+
indent = this.adjustIndent(indent);
|
|
50
|
+
|
|
51
|
+
const childNodesHTML = this.childNodesAsHTML(indent, context),
|
|
52
|
+
startingTag = this.startingTag(context),
|
|
53
|
+
closingTag = this.closingTag(context),
|
|
54
|
+
html = (indent !== null) ?
|
|
55
|
+
`${indent}${startingTag}${childNodesHTML}${closingTag}
|
|
56
|
+
`: `${startingTag}${childNodesHTML}${closingTag}`;
|
|
57
|
+
|
|
58
|
+
return html;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
61
|
childNodesAsHTML(indent, context) {
|
|
62
62
|
const childNodes = this.getChildNodes(),
|
|
63
|
-
html = htmlFromChildNodes(childNodes, context)
|
|
63
|
+
html = htmlFromChildNodes(childNodes, context),
|
|
64
|
+
childNodesHTML = html; ///
|
|
64
65
|
|
|
65
|
-
return
|
|
66
|
+
return childNodesHTML;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
childNodesAsPlainText(context) {
|
|
69
70
|
const childNodes = this.getChildNodes(),
|
|
70
|
-
plainText = plainTextFromChildNodes(childNodes, context)
|
|
71
|
+
plainText = plainTextFromChildNodes(childNodes, context),
|
|
72
|
+
childNodesPlainText = plainText; ///
|
|
71
73
|
|
|
72
|
-
return
|
|
74
|
+
return childNodesPlainText;
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(LineMarkdownNode, ruleName, childNodes, opacity); }
|
|
@@ -5,8 +5,14 @@ import MarkdownNode from "../../node/markdown";
|
|
|
5
5
|
import { CARRIAGE_RETURN } from "../../constants";
|
|
6
6
|
|
|
7
7
|
export default class VerticalSpaceMarkdownNode extends MarkdownNode {
|
|
8
|
+
content(context) {
|
|
9
|
+
const content = CARRIAGE_RETURN;
|
|
10
|
+
|
|
11
|
+
return content;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
createDOMElement(context) {
|
|
9
|
-
const content =
|
|
15
|
+
const content = this.content(context),
|
|
10
16
|
textNode = document.createTextNode(content),
|
|
11
17
|
domElement = textNode; ///
|
|
12
18
|
|
|
@@ -14,10 +20,20 @@ export default class VerticalSpaceMarkdownNode extends MarkdownNode {
|
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
asHTML(indent, context) {
|
|
17
|
-
const
|
|
23
|
+
const content = this.content(context),
|
|
24
|
+
html = content; ///
|
|
18
25
|
|
|
19
26
|
return html;
|
|
20
27
|
}
|
|
21
28
|
|
|
29
|
+
asPlainText(context) {
|
|
30
|
+
const content = this.content(context),
|
|
31
|
+
plainText = content; ///
|
|
32
|
+
|
|
33
|
+
return plainText;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static lines = 0;
|
|
37
|
+
|
|
22
38
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(VerticalSpaceMarkdownNode, ruleName, childNodes, opacity); }
|
|
23
39
|
}
|