highmark-markdown 0.0.109 → 0.0.112
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 +30 -39
- package/lib/example/constants.js +8 -4
- package/lib/example/view.js +13 -5
- package/lib/markdown/bnf.js +2 -2
- package/lib/node/markdown/directive.js +3 -3
- package/lib/node/markdown/division.js +1 -3
- package/lib/node/markdown/import.js +4 -3
- package/lib/node/markdown.js +5 -25
- package/package.json +1 -1
- package/src/example/constants.js +2 -1
- package/src/example/view.js +24 -4
- package/src/markdown/bnf.js +1 -1
- package/src/node/markdown/directive.js +4 -4
- package/src/node/markdown/division.js +0 -3
- package/src/node/markdown/import.js +5 -2
- package/src/node/markdown.js +21 -37
package/src/node/markdown.js
CHANGED
|
@@ -46,22 +46,15 @@ class MarkdownNode extends NonTerminalNode {
|
|
|
46
46
|
startingTag(context) {
|
|
47
47
|
const tagName = this.tagName(context),
|
|
48
48
|
className = this.className(context),
|
|
49
|
-
attributeName = this.attributeName(context)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (attributeName !== null) {
|
|
59
|
-
const attributeValue = this.attributeValue(context);
|
|
60
|
-
|
|
61
|
-
attributeHTML = ` ${attributeName}="${attributeValue}"`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const startingTag = `<${tagName}${classHTML}${attributeHTML}>`;
|
|
49
|
+
attributeName = this.attributeName(context),
|
|
50
|
+
attributeValue = this.attributeValue(context),
|
|
51
|
+
classHTML = (className !== null) ?
|
|
52
|
+
` class="${className}"` :
|
|
53
|
+
EMPTY_STRING,
|
|
54
|
+
attributeHTML = ((attributeName !== null) && (attributeValue !== null)) ?
|
|
55
|
+
` ${attributeName}="${attributeValue}"` :
|
|
56
|
+
EMPTY_STRING,
|
|
57
|
+
startingTag = `<${tagName}${classHTML}${attributeHTML}>`;
|
|
65
58
|
|
|
66
59
|
return startingTag;
|
|
67
60
|
}
|
|
@@ -69,22 +62,15 @@ class MarkdownNode extends NonTerminalNode {
|
|
|
69
62
|
selfClosingTag(context) {
|
|
70
63
|
const tagName = this.tagName(context),
|
|
71
64
|
className = this.className(context),
|
|
72
|
-
attributeName = this.attributeName(context)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (attributeName !== null) {
|
|
82
|
-
const attributeValue = this.attributeValue(context);
|
|
83
|
-
|
|
84
|
-
attributeHTML = ` ${attributeName}="${attributeValue}"`;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const selfClosingTag = `<${tagName}${classHTML}${attributeHTML}/>`;
|
|
65
|
+
attributeName = this.attributeName(context),
|
|
66
|
+
attributeValue = this.attributeValue(context),
|
|
67
|
+
classHTML = (className !== null) ?
|
|
68
|
+
` class="${className}"` :
|
|
69
|
+
EMPTY_STRING,
|
|
70
|
+
attributeHTML = ((attributeName !== null) && (attributeValue !== null)) ?
|
|
71
|
+
` ${attributeName}="${attributeValue}"` :
|
|
72
|
+
EMPTY_STRING,
|
|
73
|
+
selfClosingTag = `<${tagName}${classHTML}${attributeHTML}/>`;
|
|
88
74
|
|
|
89
75
|
return selfClosingTag;
|
|
90
76
|
}
|
|
@@ -177,22 +163,20 @@ ${indent}${closingTag}
|
|
|
177
163
|
if (tagName !== null) {
|
|
178
164
|
domElement = document.createElement(tagName);
|
|
179
165
|
|
|
180
|
-
this.setDOMElement(domElement);
|
|
181
|
-
|
|
182
166
|
const className = this.className(context),
|
|
183
167
|
attributeName = this.attributeName(context),
|
|
184
168
|
attributeValue = this.attributeValue(context);
|
|
185
169
|
|
|
186
170
|
if (className !== null) {
|
|
187
|
-
|
|
188
|
-
className
|
|
189
|
-
});
|
|
171
|
+
domElement.className = className;
|
|
190
172
|
}
|
|
191
173
|
|
|
192
174
|
if ((attributeName !== null) && (attributeValue !== null)) {
|
|
193
175
|
domElement.setAttribute(attributeName, attributeValue);
|
|
194
176
|
}
|
|
195
177
|
|
|
178
|
+
this.setDOMElement(domElement);
|
|
179
|
+
|
|
196
180
|
this.createChildNodeDOMElements(context);
|
|
197
181
|
}
|
|
198
182
|
|