highmark-markdown 1.0.173 → 1.0.174
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/README.md +1 -1
- package/example.js +14061 -13787
- package/lib/example/importer.js +5 -5
- package/lib/example/view/div/container/markdown.js +3 -3
- package/lib/example/view/div/preview.js +5 -1
- package/lib/example/view/textarea/parseTree/{markdown/outer.js → html.js} +17 -17
- package/lib/example/view/textarea/parseTree/markdown.js +49 -2
- package/lib/example/view/textarea/plainText.js +7 -2
- package/lib/example/view/xmp.js +7 -2
- package/lib/example/view.js +67 -104
- package/lib/index/match.js +6 -6
- package/lib/index.js +27 -15
- package/lib/map/className.js +60 -0
- package/lib/map/node/html.js +85 -0
- package/lib/map/node/markdown.js +73 -0
- package/lib/map/tagName.js +60 -0
- package/lib/markdown/bnf.js +2 -2
- package/lib/markdown/parser.js +10 -9
- package/lib/markdownStyle/entries.js +3 -3
- package/lib/mixins/node.js +24 -23
- package/lib/node/html/anchor.js +55 -11
- package/lib/node/html/blockLine.js +75 -9
- package/lib/node/html/division.js +135 -0
- package/lib/node/html/error.js +195 -0
- package/lib/node/html/{blockListingEnd.js → footnote.js} +20 -14
- package/lib/node/html/heading/index.js +128 -0
- package/lib/node/html/heading/primary.js +129 -0
- package/lib/node/{markdown/directive.js → html/heading/quaternary.js} +21 -21
- package/lib/node/html/heading/secondary.js +129 -0
- package/lib/node/html/heading/tertiary.js +129 -0
- package/lib/node/html/image.js +214 -0
- package/lib/node/html/indexList.js +128 -0
- package/lib/node/html/item/contents.js +128 -0
- package/lib/node/html/item/footnotes.js +128 -0
- package/lib/node/{markdown/indexItem.js → html/item/index.js} +36 -15
- package/lib/node/html/item/ordered.js +17 -2
- package/lib/node/html/item/unordered.js +128 -0
- package/lib/node/html/line.js +174 -0
- package/lib/node/html/{contentsLink.js → link/contents.js} +19 -4
- package/lib/node/html/link/email.js +229 -0
- package/lib/node/html/link/footnote.js +137 -0
- package/lib/node/html/link/hyper.js +229 -0
- package/lib/node/html/link/index.js +202 -0
- package/lib/node/html/list/contents.js +128 -0
- package/lib/node/html/list/footnotes.js +144 -0
- package/lib/node/html/list/ordered.js +128 -0
- package/lib/node/html/list/unordered.js +128 -0
- package/lib/node/html/{blockListing.js → listing/block.js} +18 -9
- package/lib/node/html/listing/inline.js +189 -0
- package/lib/node/html/pageNumber.js +170 -0
- package/lib/node/html/{className.js → paragraph.js} +26 -18
- package/lib/node/{markdown/nonsense.js → html/table.js} +22 -15
- package/lib/node/{markdown/blockListingEnd.js → html/tableBody.js} +22 -15
- package/lib/node/html/tableBodyCell.js +128 -0
- package/lib/node/html/tableBodyRow.js +128 -0
- package/lib/node/html/{blockListingStart.js → tableHead.js} +26 -18
- package/lib/node/html/tableHeadCell.js +128 -0
- package/lib/node/html/tableHeadRow.js +128 -0
- package/lib/node/html/text/block.js +128 -0
- package/lib/node/html/text/emphasised.js +128 -0
- package/lib/node/html/text/inline.js +196 -0
- package/lib/node/html/text/plain.js +128 -0
- package/lib/node/html/text/strong.js +128 -0
- package/lib/node/html/text/stronglyEmphasised.js +212 -0
- package/lib/node/html/text.js +141 -0
- package/lib/node/html/topmost.js +57 -10
- package/lib/node/html.js +130 -40
- package/lib/node/markdown/anchor.js +6 -22
- package/lib/node/markdown/{table.js → blockEnd.js} +10 -10
- package/lib/node/markdown/blockListing.js +4 -31
- package/lib/node/markdown/{blockListingStart.js → blockStart.js} +10 -24
- package/lib/node/markdown/className.js +2 -2
- package/lib/node/markdown/contentsItem.js +4 -4
- package/lib/node/markdown/contentsList.js +2 -10
- package/lib/node/markdown/directive/embee.js +13 -13
- package/lib/node/markdown/directive/include.js +13 -13
- package/lib/node/markdown/directive/pageNumber.js +13 -29
- package/lib/node/markdown/division.js +205 -254
- package/lib/node/markdown/emailLink.js +36 -98
- package/lib/node/markdown/emphasisedText.js +3 -54
- package/lib/node/markdown/error.js +9 -53
- package/lib/node/markdown/footnote.js +1 -15
- package/lib/node/markdown/footnoteLink.js +9 -32
- package/lib/node/markdown/footnotesList.js +1 -16
- package/lib/node/markdown/heading/primary.js +1 -2
- package/lib/node/markdown/heading/quaternary.js +1 -2
- package/lib/node/markdown/heading/secondary.js +1 -2
- package/lib/node/markdown/heading/tertiary.js +1 -2
- package/lib/node/markdown/heading.js +1 -13
- package/lib/node/markdown/hyperlink.js +44 -108
- package/lib/node/markdown/image.js +2 -63
- package/lib/node/markdown/indexLink.js +13 -87
- package/lib/node/markdown/indexList.js +2 -10
- package/lib/node/markdown/inlineListing.js +22 -56
- package/lib/node/markdown/inlineText.js +3 -21
- package/lib/node/markdown/item/ordered.js +6 -6
- package/lib/node/markdown/line.js +1 -74
- package/lib/node/markdown/path.js +7 -7
- package/lib/node/markdown/strongText.js +3 -54
- package/lib/node/markdown/stronglyEmphasisedText.js +3 -78
- package/lib/node/markdown/{tableCellDivider.js → text/block.js} +12 -12
- package/lib/node/markdown/{tableBody.js → text/plain.js} +12 -12
- package/lib/node/markdown/text.js +154 -0
- package/lib/node/markdown/topmost.js +191 -0
- package/lib/node/markdown.js +6 -229
- package/lib/queries.js +4 -45
- package/lib/ruleNames.js +34 -21
- package/lib/style/selector.js +11 -7
- package/lib/transform/contentsItem.js +134 -0
- package/lib/transform/contentsLink.js +115 -0
- package/lib/transform/contentsList.js +194 -0
- package/lib/{replacement/subDivision.js → transform/division.js} +33 -38
- package/lib/{replacement → transform}/embedDirective.js +14 -19
- package/lib/{replacement → transform}/footnote.js +18 -23
- package/lib/transform/footnotesItem.js +123 -0
- package/lib/transform/footnotesList.js +173 -0
- package/lib/{replacement → transform}/includeDirective.js +13 -18
- package/lib/transform/index.js +166 -0
- package/lib/{replacement → transform}/indexAnchor.js +13 -13
- package/lib/{replacement → transform}/indexHeading.js +13 -18
- package/lib/{replacement → transform}/indexItem.js +13 -18
- package/lib/transform/indexList.js +121 -0
- package/lib/{replacement → transform}/line.js +13 -18
- package/lib/{replacement → transform}/subDivision/contentsDirective.js +14 -14
- package/lib/transform/subDivision/embedDirectives.js +147 -0
- package/lib/{replacement → transform}/subDivision/footnote.js +14 -14
- package/lib/{replacement → transform}/subDivision/footnotesDirective.js +14 -14
- package/lib/transform/subDivision/includeDirectives.js +142 -0
- package/lib/{replacement → transform}/subDivision/indexDirective.js +14 -14
- package/lib/{replacement → transform}/subDivision/pageNumberDirective.js +14 -14
- package/lib/utilities/content.js +1 -61
- package/lib/utilities/entities.js +17 -0
- package/lib/utilities/entries.js +6 -6
- package/lib/utilities/html.js +67 -9
- package/lib/utilities/markdown.js +45 -0
- package/lib/utilities/parser.js +8 -2
- package/lib/utilities/query.js +2 -22
- package/package.json +2 -2
- package/src/example/importer.js +2 -4
- package/src/example/view/div/container/markdown.js +2 -2
- package/src/example/view/div/preview.js +6 -0
- package/src/example/view/textarea/parseTree/html.js +28 -0
- package/src/example/view/textarea/parseTree/markdown.js +19 -1
- package/src/example/view/textarea/plainText.js +9 -1
- package/src/example/view/xmp.js +9 -1
- package/src/example/view.js +84 -91
- package/src/index/match.js +6 -6
- package/src/index.js +6 -3
- package/src/map/className.js +16 -0
- package/src/map/node/html.js +136 -0
- package/src/map/node/markdown.js +125 -0
- package/src/map/tagName.js +16 -0
- package/src/markdown/bnf.js +85 -64
- package/src/markdown/parser.js +3 -1
- package/src/markdownStyle/entries.js +3 -3
- package/src/mixins/node.js +29 -34
- package/src/node/html/anchor.js +26 -5
- package/src/node/html/blockLine.js +58 -7
- package/src/node/html/division.js +15 -0
- package/src/node/html/error.js +64 -0
- package/src/node/html/footnote.js +17 -0
- package/src/node/html/heading/index.js +13 -0
- package/src/node/html/heading/primary.js +15 -0
- package/src/node/html/heading/quaternary.js +15 -0
- package/src/node/html/heading/secondary.js +15 -0
- package/src/node/html/heading/tertiary.js +15 -0
- package/src/node/html/image.js +107 -0
- package/src/node/html/indexList.js +13 -0
- package/src/node/html/item/contents.js +13 -0
- package/src/node/html/item/footnotes.js +13 -0
- package/src/node/{markdown/indexItem.js → html/item/index.js} +9 -3
- package/src/node/html/item/ordered.js +5 -1
- package/src/node/html/item/unordered.js +13 -0
- package/src/node/html/line.js +64 -0
- package/src/node/html/{contentsLink.js → link/contents.js} +7 -3
- package/src/node/html/link/email.js +96 -0
- package/src/node/html/link/footnote.js +33 -0
- package/src/node/html/link/hyper.js +96 -0
- package/src/node/html/link/index.js +72 -0
- package/src/node/html/list/contents.js +13 -0
- package/src/node/html/list/footnotes.js +27 -0
- package/src/node/html/list/ordered.js +13 -0
- package/src/node/html/list/unordered.js +13 -0
- package/src/node/html/{blockListing.js → listing/block.js} +5 -8
- package/src/node/html/listing/inline.js +61 -0
- package/src/node/html/pageNumber.js +46 -0
- package/src/node/html/paragraph.js +13 -0
- package/src/node/html/table.js +13 -0
- package/src/node/html/tableBody.js +13 -0
- package/src/node/html/tableBodyCell.js +13 -0
- package/src/node/html/tableBodyRow.js +13 -0
- package/src/node/html/tableHead.js +13 -0
- package/src/node/html/tableHeadCell.js +13 -0
- package/src/node/html/tableHeadRow.js +13 -0
- package/src/node/html/text/block.js +13 -0
- package/src/node/html/text/emphasised.js +13 -0
- package/src/node/html/text/inline.js +57 -0
- package/src/node/html/text/plain.js +13 -0
- package/src/node/html/text/strong.js +13 -0
- package/src/node/html/text/stronglyEmphasised.js +98 -0
- package/src/node/html/text.js +34 -0
- package/src/node/html/topmost.js +57 -8
- package/src/node/html.js +136 -53
- package/src/node/markdown/anchor.js +5 -25
- package/src/node/markdown/{table.js → blockEnd.js} +2 -2
- package/src/node/markdown/blockListing.js +4 -10
- package/src/node/markdown/{blockListingStart.js → blockStart.js} +4 -6
- package/src/node/markdown/className.js +2 -2
- package/src/node/markdown/contentsItem.js +4 -4
- package/src/node/markdown/contentsList.js +0 -6
- package/src/node/markdown/directive/embee.js +10 -10
- package/src/node/markdown/directive/include.js +10 -10
- package/src/node/markdown/directive/pageNumber.js +10 -29
- package/src/node/markdown/division.js +203 -260
- package/src/node/markdown/emailLink.js +41 -87
- package/src/node/markdown/emphasisedText.js +1 -40
- package/src/node/markdown/error.js +9 -40
- package/src/node/markdown/footnote.js +0 -12
- package/src/node/markdown/footnoteLink.js +8 -31
- package/src/node/markdown/footnotesList.js +0 -13
- package/src/node/markdown/heading/primary.js +0 -2
- package/src/node/markdown/heading/quaternary.js +0 -2
- package/src/node/markdown/heading/secondary.js +0 -2
- package/src/node/markdown/heading/tertiary.js +0 -2
- package/src/node/markdown/heading.js +0 -14
- package/src/node/markdown/hyperlink.js +41 -91
- package/src/node/markdown/image.js +1 -82
- package/src/node/markdown/indexLink.js +10 -69
- package/src/node/markdown/indexList.js +0 -6
- package/src/node/markdown/inlineListing.js +20 -40
- package/src/node/markdown/inlineText.js +1 -21
- package/src/node/markdown/item/ordered.js +3 -3
- package/src/node/markdown/line.js +0 -61
- package/src/node/markdown/path.js +5 -5
- package/src/node/markdown/strongText.js +1 -40
- package/src/node/markdown/stronglyEmphasisedText.js +1 -74
- package/src/node/markdown/text/block.js +7 -0
- package/src/node/markdown/text/plain.js +7 -0
- package/src/node/markdown/text.js +80 -0
- package/src/node/markdown/topmost.js +91 -0
- package/src/node/markdown.js +1 -200
- package/src/queries.js +6 -86
- package/src/ruleNames.js +16 -12
- package/src/style/selector.js +16 -10
- package/src/transform/contentsItem.js +55 -0
- package/src/{replacement → transform}/contentsLink.js +10 -9
- package/src/{replacement → transform}/contentsList.js +26 -26
- package/src/transform/division.js +41 -0
- package/src/{replacement → transform}/embedDirective.js +4 -4
- package/src/{replacement → transform}/footnote.js +7 -7
- package/src/transform/footnotesItem.js +25 -0
- package/src/transform/footnotesList.js +79 -0
- package/src/{replacement → transform}/includeDirective.js +4 -4
- package/src/transform/index.js +90 -0
- package/src/{replacement → transform}/indexAnchor.js +5 -4
- package/src/{replacement → transform}/indexHeading.js +4 -4
- package/src/{replacement → transform}/indexItem.js +4 -4
- package/src/transform/indexList.js +33 -0
- package/src/{replacement → transform}/line.js +4 -4
- package/src/transform/subDivision/contentsDirective.js +20 -0
- package/src/transform/subDivision/embedDirectives.js +52 -0
- package/src/{replacement → transform}/subDivision/footnote.js +5 -5
- package/src/transform/subDivision/footnotesDirective.js +20 -0
- package/src/transform/subDivision/includeDirectives.js +48 -0
- package/src/transform/subDivision/indexDirective.js +20 -0
- package/src/transform/subDivision/pageNumberDirective.js +20 -0
- package/src/utilities/content.js +0 -95
- package/src/utilities/entities.js +11 -0
- package/src/utilities/entries.js +3 -3
- package/src/utilities/html.js +69 -6
- package/src/utilities/markdown.js +32 -0
- package/src/utilities/parser.js +3 -2
- package/src/utilities/query.js +8 -28
- package/lib/classFromOuterNode.js +0 -30
- package/lib/elementMap.js +0 -218
- package/lib/example/view/textarea/parseTree/markdown/inner.js +0 -179
- package/lib/mixins/content.js +0 -21
- package/lib/mixins/element.js +0 -32
- package/lib/node/html/comma.js +0 -127
- package/lib/node/html/directive/pageNumber.js +0 -178
- package/lib/node/markdown/blockLine.js +0 -207
- package/lib/node/markdown/comma.js +0 -123
- package/lib/node/markdown/directive/contents.js +0 -107
- package/lib/node/markdown/directive/footnotes.js +0 -107
- package/lib/node/markdown/directive/ignore.js +0 -107
- package/lib/node/markdown/directive/index.js +0 -107
- package/lib/node/markdown/directives.js +0 -125
- package/lib/node/markdown/emptyTableCell.js +0 -122
- package/lib/node/markdown/endOfLine.js +0 -151
- package/lib/node/markdown/indexHeading.js +0 -107
- package/lib/node/markdown/item/unordered.js +0 -107
- package/lib/node/markdown/item.js +0 -107
- package/lib/node/markdown/orderedList.js +0 -107
- package/lib/node/markdown/plainText.js +0 -115
- package/lib/node/markdown/subDivision.js +0 -161
- package/lib/node/markdown/tableBodyCell.js +0 -128
- package/lib/node/markdown/tableBodyRow.js +0 -107
- package/lib/node/markdown/tableCell.js +0 -118
- package/lib/node/markdown/tableDivider.js +0 -107
- package/lib/node/markdown/tableHead.js +0 -107
- package/lib/node/markdown/tableHeadCell.js +0 -128
- package/lib/node/markdown/tableHeadRow.js +0 -107
- package/lib/node/markdown/unorderedList.js +0 -107
- package/lib/node/markdown/verticalSpace.js +0 -151
- package/lib/nodeMap.js +0 -98
- package/lib/replacement/contentsItem.js +0 -134
- package/lib/replacement/contentsLink.js +0 -115
- package/lib/replacement/contentsList.js +0 -194
- package/lib/replacement/footnotesItem.js +0 -123
- package/lib/replacement/footnotesList.js +0 -173
- package/lib/replacement/index.js +0 -166
- package/lib/replacement/indexList.js +0 -121
- package/lib/replacement/subDivision/embedDirectives.js +0 -143
- package/lib/replacement/subDivision/includeDirectives.js +0 -175
- package/lib/replacement.js +0 -262
- package/lib/ruleNameToClassMap.js +0 -44
- package/lib/utilities/childNodes.js +0 -127
- package/lib/utilities/processing.js +0 -106
- package/lib/utilities/replacement.js +0 -195
- package/src/classFromOuterNode.js +0 -20
- package/src/elementMap.js +0 -322
- package/src/example/view/textarea/parseTree/markdown/inner.js +0 -36
- package/src/example/view/textarea/parseTree/markdown/outer.js +0 -27
- package/src/mixins/content.js +0 -16
- package/src/mixins/element.js +0 -29
- package/src/node/html/blockListingEnd.js +0 -11
- package/src/node/html/blockListingStart.js +0 -11
- package/src/node/html/className.js +0 -11
- package/src/node/html/comma.js +0 -18
- package/src/node/html/directive/pageNumber.js +0 -55
- package/src/node/markdown/blockLine.js +0 -90
- package/src/node/markdown/blockListingEnd.js +0 -9
- package/src/node/markdown/comma.js +0 -23
- package/src/node/markdown/directive/contents.js +0 -7
- package/src/node/markdown/directive/footnotes.js +0 -7
- package/src/node/markdown/directive/ignore.js +0 -7
- package/src/node/markdown/directive/index.js +0 -7
- package/src/node/markdown/directive.js +0 -15
- package/src/node/markdown/directives.js +0 -25
- package/src/node/markdown/emptyTableCell.js +0 -19
- package/src/node/markdown/endOfLine.js +0 -39
- package/src/node/markdown/indexHeading.js +0 -7
- package/src/node/markdown/item/unordered.js +0 -7
- package/src/node/markdown/item.js +0 -7
- package/src/node/markdown/nonsense.js +0 -9
- package/src/node/markdown/orderedList.js +0 -7
- package/src/node/markdown/plainText.js +0 -13
- package/src/node/markdown/subDivision.js +0 -64
- package/src/node/markdown/tableBody.js +0 -7
- package/src/node/markdown/tableBodyCell.js +0 -29
- package/src/node/markdown/tableBodyRow.js +0 -7
- package/src/node/markdown/tableCell.js +0 -19
- package/src/node/markdown/tableCellDivider.js +0 -7
- package/src/node/markdown/tableDivider.js +0 -7
- package/src/node/markdown/tableHead.js +0 -7
- package/src/node/markdown/tableHeadCell.js +0 -29
- package/src/node/markdown/tableHeadRow.js +0 -7
- package/src/node/markdown/unorderedList.js +0 -7
- package/src/node/markdown/verticalSpace.js +0 -39
- package/src/nodeMap.js +0 -200
- package/src/replacement/contentsItem.js +0 -54
- package/src/replacement/footnotesItem.js +0 -24
- package/src/replacement/footnotesList.js +0 -78
- package/src/replacement/index.js +0 -89
- package/src/replacement/indexList.js +0 -32
- package/src/replacement/subDivision/contentsDirective.js +0 -20
- package/src/replacement/subDivision/embedDirectives.js +0 -52
- package/src/replacement/subDivision/footnotesDirective.js +0 -20
- package/src/replacement/subDivision/includeDirectives.js +0 -58
- package/src/replacement/subDivision/indexDirective.js +0 -20
- package/src/replacement/subDivision/pageNumberDirective.js +0 -20
- package/src/replacement/subDivision.js +0 -41
- package/src/replacement.js +0 -185
- package/src/ruleNameToClassMap.js +0 -38
- package/src/utilities/childNodes.js +0 -178
- package/src/utilities/processing.js +0 -122
- package/src/utilities/replacement.js +0 -169
|
@@ -1,114 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import MarkdownNode from "../../node/markdown";
|
|
4
|
-
import contentMixins from "../../mixins/content";
|
|
5
4
|
|
|
6
|
-
import {
|
|
5
|
+
import { EMAIL_ADDRESS_TOKEN_TYPE } from "../../tokenTypes";
|
|
7
6
|
|
|
8
|
-
class EmailLinkMarkdownNode extends MarkdownNode {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export default class EmailLinkMarkdownNode extends MarkdownNode {
|
|
8
|
+
emailAddressFromSecondLastChildNode(context) {
|
|
9
|
+
const emailAddress = this.fromSecondLastChildNode((secondLastChildNode) => {
|
|
10
|
+
const terminalNode = secondLastChildNode, ///
|
|
11
|
+
emailAddress = emailAddressFromTerminalNode(terminalNode);
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
return emailAddress;
|
|
14
|
+
});
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
inlineText = this.fromSecondChildNode((secondChildNode) => {
|
|
16
|
-
const indent = null,
|
|
17
|
-
inlineTextMarkdownNode = secondChildNode, ///
|
|
18
|
-
inlineTextMarkdownNodeHTML = inlineTextMarkdownNode.asHTML(indent, context);
|
|
19
|
-
|
|
20
|
-
inlineText = inlineTextMarkdownNodeHTML; ///
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return inlineText;
|
|
16
|
+
return emailAddress;
|
|
25
17
|
}
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (multiplicity === 1) {
|
|
33
|
-
emailAddressTerminalNode = this.fromFirstChildNode((firstChildNode) => {
|
|
34
|
-
const emailAddressTerminalNode = firstChildNode; ///
|
|
35
|
-
|
|
36
|
-
return emailAddressTerminalNode;
|
|
37
|
-
});
|
|
38
|
-
} else {
|
|
39
|
-
emailAddressTerminalNode = this.fromSecondLastChildNode((secondLastChildNode) => {
|
|
40
|
-
const emailAddressTerminalNode = secondLastChildNode; ///
|
|
19
|
+
emailAddressFromFirstLastChildNode(context) {
|
|
20
|
+
const emailAddress = this.fromFirstLastChildNode((firstLastChildNode) => {
|
|
21
|
+
const terminalNode = firstLastChildNode, ///
|
|
22
|
+
emailAddress = emailAddressFromTerminalNode(terminalNode);
|
|
41
23
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const emailAddressTerminalNodeContent = emailAddressTerminalNode.getContent(),
|
|
47
|
-
emailAddress = emailAddressTerminalNodeContent; ///
|
|
24
|
+
return emailAddress;
|
|
25
|
+
});
|
|
48
26
|
|
|
49
27
|
return emailAddress;
|
|
50
28
|
}
|
|
51
29
|
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
attributeValue(context) {
|
|
59
|
-
const emailAddress = this.emailAddress(context),
|
|
60
|
-
attributeValue = `mailto:${emailAddress}`;
|
|
30
|
+
emailAddress(context) {
|
|
31
|
+
const simple = this.isSimple(),
|
|
32
|
+
emailAddress = simple ?
|
|
33
|
+
this.emailAddressFromFirstLastChildNode(context) :
|
|
34
|
+
this.emailAddressFromSecondLastChildNode(context);
|
|
61
35
|
|
|
62
|
-
return
|
|
36
|
+
return emailAddress;
|
|
63
37
|
}
|
|
64
38
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
39
|
+
isSimple() {
|
|
40
|
+
const simple = this.fromFirstLastChildNode((firstLastChildNode) => {
|
|
41
|
+
const terminalNode = firstLastChildNode, ///
|
|
42
|
+
type = terminalNode.getType(),
|
|
43
|
+
typeEmailAddressTokenType = (type === EMAIL_ADDRESS_TOKEN_TYPE),
|
|
44
|
+
simple = typeEmailAddressTokenType; ///
|
|
69
45
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else {
|
|
73
|
-
content = this.content(context);
|
|
74
|
-
}
|
|
46
|
+
return simple;
|
|
47
|
+
});
|
|
75
48
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const textNode = document.createTextNode(content);
|
|
79
|
-
|
|
80
|
-
domElement = super.createDOMElement(context);
|
|
81
|
-
|
|
82
|
-
const parentDOMElement = domElement; ///
|
|
83
|
-
|
|
84
|
-
domElement = textNode; ///
|
|
85
|
-
|
|
86
|
-
parentDOMElement.appendChild(domElement);
|
|
87
|
-
|
|
88
|
-
domElement = parentDOMElement; ///
|
|
89
|
-
|
|
90
|
-
return domElement;
|
|
49
|
+
return simple;
|
|
91
50
|
}
|
|
92
51
|
|
|
93
|
-
|
|
94
|
-
|
|
52
|
+
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(EmailLinkMarkdownNode, ruleName, childNodes, opacity); }
|
|
53
|
+
}
|
|
95
54
|
|
|
96
|
-
|
|
55
|
+
function emailAddressFromTerminalNode(terminalNode) {
|
|
56
|
+
let emailAddress = null;
|
|
97
57
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} else {
|
|
101
|
-
content = this.content(context);
|
|
102
|
-
}
|
|
58
|
+
const type = terminalNode.getType(),
|
|
59
|
+
typeEmailAddressTokenType = (type === EMAIL_ADDRESS_TOKEN_TYPE);
|
|
103
60
|
|
|
104
|
-
|
|
61
|
+
if (typeEmailAddressTokenType) {
|
|
62
|
+
const content = terminalNode.getContent();
|
|
105
63
|
|
|
106
|
-
|
|
64
|
+
emailAddress = content; ///
|
|
107
65
|
}
|
|
108
66
|
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
Object.assign(EmailLinkMarkdownNode.prototype, contentMixins);
|
|
113
|
-
|
|
114
|
-
export default EmailLinkMarkdownNode;
|
|
67
|
+
return emailAddress;
|
|
68
|
+
}
|
|
@@ -1,46 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import MarkdownNode from "../../node/markdown";
|
|
4
|
-
import contentMixins from "../../mixins/content";
|
|
5
|
-
|
|
6
|
-
class EmphasisedTextMarkdownNode extends MarkdownNode {
|
|
7
|
-
inlineText(context) {
|
|
8
|
-
const inlineText = this.fromSecondChildNode((secondChildNode) => {
|
|
9
|
-
const indent = null,
|
|
10
|
-
inlineTextMarkdownNode = secondChildNode, ///
|
|
11
|
-
inlineTextMarkdownNodeHTML = inlineTextMarkdownNode.asHTML(indent, context),
|
|
12
|
-
inlineText = inlineTextMarkdownNodeHTML; ///
|
|
13
|
-
|
|
14
|
-
return inlineText;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return inlineText;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
createDOMElement(context) {
|
|
21
|
-
const inlineText = this.inlineText(context),
|
|
22
|
-
content = inlineText; ///
|
|
23
|
-
|
|
24
|
-
let domElement;
|
|
25
|
-
|
|
26
|
-
const textNode = document.createTextNode(content);
|
|
27
|
-
|
|
28
|
-
domElement = super.createDOMElement(context);
|
|
29
|
-
|
|
30
|
-
const parentDOMElement = domElement; ///
|
|
31
|
-
|
|
32
|
-
domElement = textNode; ///
|
|
33
|
-
|
|
34
|
-
parentDOMElement.appendChild(domElement);
|
|
35
|
-
|
|
36
|
-
domElement = parentDOMElement; ///
|
|
37
|
-
|
|
38
|
-
return domElement;
|
|
39
|
-
}
|
|
40
4
|
|
|
5
|
+
export default class EmphasisedTextMarkdownNode extends MarkdownNode {
|
|
41
6
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(EmphasisedTextMarkdownNode, ruleName, childNodes, opacity); }
|
|
42
7
|
}
|
|
43
|
-
|
|
44
|
-
Object.assign(EmphasisedTextMarkdownNode.prototype, contentMixins);
|
|
45
|
-
|
|
46
|
-
export default EmphasisedTextMarkdownNode;
|
|
@@ -1,50 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import MarkdownNode from "../../node/markdown";
|
|
4
|
-
import contentMixins from "../../mixins/content";
|
|
5
4
|
|
|
6
|
-
class ErrorMarkdownNode extends MarkdownNode {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export default class ErrorMarkdownNode extends MarkdownNode {
|
|
6
|
+
error(context) {
|
|
7
|
+
const error = this.fromFirstChildNode((firstChildNode) => {
|
|
8
|
+
const terminalNode = firstChildNode, ///
|
|
9
|
+
content = terminalNode.getContent(),
|
|
10
|
+
error = content; ///
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
closingTag = this.closingTag(context),
|
|
13
|
-
html = `${indent}${startingTag}${childNodesHTML}${closingTag}
|
|
14
|
-
`;
|
|
12
|
+
return error;
|
|
13
|
+
});
|
|
15
14
|
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
createDOMElement(context) {
|
|
20
|
-
let domElement;
|
|
21
|
-
|
|
22
|
-
const content = this.content(context),
|
|
23
|
-
textNode = document.createTextNode(content);
|
|
24
|
-
|
|
25
|
-
domElement = super.createDOMElement(context);
|
|
26
|
-
|
|
27
|
-
const parentDOMElement = domElement;
|
|
28
|
-
|
|
29
|
-
domElement = textNode; ///
|
|
30
|
-
|
|
31
|
-
parentDOMElement.appendChild(domElement);
|
|
32
|
-
|
|
33
|
-
domElement = parentDOMElement; ///
|
|
34
|
-
|
|
35
|
-
return domElement;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
childNodesAsHTML(indent, context) {
|
|
39
|
-
const content = this.content(context),
|
|
40
|
-
childNodesHTML = content; ///
|
|
41
|
-
|
|
42
|
-
return childNodesHTML;
|
|
15
|
+
return error;
|
|
43
16
|
}
|
|
44
17
|
|
|
45
18
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(ErrorMarkdownNode, ruleName, childNodes, opacity); }
|
|
46
19
|
}
|
|
47
|
-
|
|
48
|
-
Object.assign(ErrorMarkdownNode.prototype, contentMixins);
|
|
49
|
-
|
|
50
|
-
export default ErrorMarkdownNode;
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { arrayUtilities } from "necessary";
|
|
4
|
-
|
|
5
3
|
import MarkdownNode from "../../node/markdown";
|
|
6
4
|
|
|
7
|
-
const { first } = arrayUtilities;
|
|
8
|
-
|
|
9
5
|
export default class FootnoteMarkdownNode extends MarkdownNode {
|
|
10
|
-
mount(parentDOMElement, siblingDOMElement, context) {
|
|
11
|
-
///
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
unmount(parentDOMElement, context) {
|
|
15
|
-
///
|
|
16
|
-
}
|
|
17
|
-
|
|
18
6
|
identifier(context) {
|
|
19
7
|
const identifier = this.fromFirstChildNode((firstChildNode) => {
|
|
20
8
|
const referenceMarkdownNode = firstChildNode, ///
|
|
@@ -5,10 +5,8 @@ import { arrayUtilities } from "necessary";
|
|
|
5
5
|
import MarkdownNode from "../../node/markdown";
|
|
6
6
|
|
|
7
7
|
import { EMPTY_STRING } from "../../constants";
|
|
8
|
-
import { FOOTNOTE_PREPEND } from "../../prepends";
|
|
9
|
-
import { HREF_ATTRIBUTE_NAME } from "../../attributeNames";
|
|
10
8
|
|
|
11
|
-
const {
|
|
9
|
+
const { second } = arrayUtilities;
|
|
12
10
|
|
|
13
11
|
export default class FootnoteLinkMarkdownNode extends MarkdownNode {
|
|
14
12
|
constructor(ruleName, childNodes, opacity, precedence, domElement, number) {
|
|
@@ -25,13 +23,13 @@ export default class FootnoteLinkMarkdownNode extends MarkdownNode {
|
|
|
25
23
|
this.number = number;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
content(context) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
26
|
+
// content(context) {
|
|
27
|
+
// const content = (this.number !== null) ?
|
|
28
|
+
// this.number :
|
|
29
|
+
// EMPTY_STRING;
|
|
30
|
+
//
|
|
31
|
+
// return content;
|
|
32
|
+
// }
|
|
35
33
|
|
|
36
34
|
identifier(context) {
|
|
37
35
|
const identifier = this.fromFirstChildNode((firstChildNode) => {
|
|
@@ -44,20 +42,6 @@ export default class FootnoteLinkMarkdownNode extends MarkdownNode {
|
|
|
44
42
|
return identifier;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
attributeName(context) {
|
|
48
|
-
const attributeName = HREF_ATTRIBUTE_NAME;
|
|
49
|
-
|
|
50
|
-
return attributeName;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
attributeValue(context) {
|
|
54
|
-
const prepend = FOOTNOTE_PREPEND,
|
|
55
|
-
identifier = this.identifier(context),
|
|
56
|
-
attributeValue = `#${prepend}-${identifier}`; ///
|
|
57
|
-
|
|
58
|
-
return attributeValue;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
45
|
clear() {
|
|
62
46
|
if (this.domElement === null) {
|
|
63
47
|
return;
|
|
@@ -97,13 +81,6 @@ export default class FootnoteLinkMarkdownNode extends MarkdownNode {
|
|
|
97
81
|
this.update(context);
|
|
98
82
|
}
|
|
99
83
|
|
|
100
|
-
childNodesAsHTML(indent, context) {
|
|
101
|
-
const content = this.content(context),
|
|
102
|
-
childNodesHTML = content; ///
|
|
103
|
-
|
|
104
|
-
return childNodesHTML;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
84
|
clone() { return super.clone(this.number); }
|
|
108
85
|
|
|
109
86
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import MarkdownNode from "../../node/markdown";
|
|
4
4
|
|
|
5
|
-
import { START_ATTRIBUTE_NAME } from "../../attributeNames";
|
|
6
5
|
import { FOOTNOTES_LIST_RULE_NAME } from "../../ruleNames";
|
|
7
6
|
|
|
8
7
|
export default class FootnotesListMarkdownNode extends MarkdownNode {
|
|
@@ -16,18 +15,6 @@ export default class FootnotesListMarkdownNode extends MarkdownNode {
|
|
|
16
15
|
return this.start;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
attributeName(context) {
|
|
20
|
-
const attributeName = START_ATTRIBUTE_NAME;
|
|
21
|
-
|
|
22
|
-
return attributeName;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
attributeValue(context) {
|
|
26
|
-
const attributeValue = this.start; ///
|
|
27
|
-
|
|
28
|
-
return attributeValue;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
18
|
clone() { return super.clone(this.start); }
|
|
32
19
|
|
|
33
20
|
static fromDOMElement(domElement) {
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
import HeadingMarkdownNode from "../../../node/markdown/heading";
|
|
4
4
|
|
|
5
5
|
export default class PrimaryHeadingMarkdownNode extends HeadingMarkdownNode {
|
|
6
|
-
static lines = 3;
|
|
7
|
-
|
|
8
6
|
static depth = 1;
|
|
9
7
|
|
|
10
8
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return HeadingMarkdownNode.fromRuleNameChildNodesAndOpacity(PrimaryHeadingMarkdownNode, ruleName, childNodes, opacity); }
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
import HeadingMarkdownNode from "../../../node/markdown/heading";
|
|
4
4
|
|
|
5
5
|
export default class QuaternaryHeadingMarkdownNode extends HeadingMarkdownNode {
|
|
6
|
-
static lines = 2;
|
|
7
|
-
|
|
8
6
|
static depth = 4;
|
|
9
7
|
|
|
10
8
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return HeadingMarkdownNode.fromRuleNameChildNodesAndOpacity(QuaternaryHeadingMarkdownNode, ruleName, childNodes, opacity); }
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
import HeadingMarkdownNode from "../../../node/markdown/heading";
|
|
4
4
|
|
|
5
5
|
export default class SecondaryHeadingMarkdownNode extends HeadingMarkdownNode {
|
|
6
|
-
static lines = 2.5;
|
|
7
|
-
|
|
8
6
|
static depth = 2;
|
|
9
7
|
|
|
10
8
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return HeadingMarkdownNode.fromRuleNameChildNodesAndOpacity(SecondaryHeadingMarkdownNode, ruleName, childNodes, opacity); }
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
import HeadingMarkdownNode from "../../../node/markdown/heading";
|
|
4
4
|
|
|
5
5
|
export default class TertiaryHeadingMarkdownNode extends HeadingMarkdownNode {
|
|
6
|
-
static lines = 2.25;
|
|
7
|
-
|
|
8
6
|
static depth = 3;
|
|
9
7
|
|
|
10
8
|
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return HeadingMarkdownNode.fromRuleNameChildNodesAndOpacity(TertiaryHeadingMarkdownNode, ruleName, childNodes, opacity); }
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { arrayUtilities } from "necessary";
|
|
4
|
-
|
|
5
3
|
import MarkdownNode from "../../node/markdown";
|
|
6
4
|
import AnchorMarkdownNode from "../../node/markdown/anchor";
|
|
7
5
|
|
|
8
6
|
import { CONTENTS_PREPEND } from "../../prepends";
|
|
9
7
|
import { replaceSpacesWithHyphens, removedLeadingWhitespace, removeNonAlphabeticAndSpaceCharacters } from "../../utilities/string";
|
|
10
8
|
|
|
11
|
-
const { last } = arrayUtilities;
|
|
12
|
-
|
|
13
9
|
export default class HeadingMarkdownNode extends MarkdownNode {
|
|
14
10
|
getDepth() {
|
|
15
11
|
const { depth } = this.constructor;
|
|
@@ -33,16 +29,6 @@ export default class HeadingMarkdownNode extends MarkdownNode {
|
|
|
33
29
|
return identifier;
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
getLineMarkdownNode() {
|
|
37
|
-
const lineMarkdownNode = this.fromFirstLastChildNode((firstLastChildNode) => {
|
|
38
|
-
const lineMarkdownNode = firstLastChildNode; ///
|
|
39
|
-
|
|
40
|
-
return lineMarkdownNode;
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return lineMarkdownNode;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
32
|
static fromRuleNameChildNodesAndOpacity(Class, ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(Class, ruleName, childNodes, opacity); }
|
|
47
33
|
}
|
|
48
34
|
|
|
@@ -1,118 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { arrayUtilities } from "necessary";
|
|
4
|
-
|
|
5
3
|
import MarkdownNode from "../../node/markdown";
|
|
6
|
-
import contentMixins from "../../mixins/content";
|
|
7
|
-
|
|
8
|
-
import { HREF_ATTRIBUTE_NAME } from "../../attributeNames";
|
|
9
|
-
|
|
10
|
-
const { second } = arrayUtilities;
|
|
11
|
-
|
|
12
|
-
class HyperlinkLinkMarkdownNode extends MarkdownNode {
|
|
13
|
-
url(context) {
|
|
14
|
-
const multiplicity = this.getMultiplicity();
|
|
15
|
-
|
|
16
|
-
let urlTerminalNode;
|
|
17
|
-
|
|
18
|
-
if (multiplicity === 1) {
|
|
19
|
-
urlTerminalNode = this.fromFirstChildNode((firstChildNode) => {
|
|
20
|
-
const urlTerminalNode = firstChildNode; ///
|
|
21
4
|
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
} else {
|
|
25
|
-
urlTerminalNode = this.fromSecondLastChildNode((secondLastChildNode) => {
|
|
26
|
-
const urlTerminalNode = secondLastChildNode; ///
|
|
5
|
+
import { URL_TOKEN_TYPE } from "../../tokenTypes";
|
|
27
6
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
export default class HyperlinkMarkdownNode extends MarkdownNode {
|
|
8
|
+
urlFromSecondLastChildNode(context) {
|
|
9
|
+
const url = this.fromSecondLastChildNode((secondLastChildNode) => {
|
|
10
|
+
const terminalNode = secondLastChildNode, ///
|
|
11
|
+
url = urlFromTerminalNode(terminalNode);
|
|
31
12
|
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
return url;
|
|
14
|
+
});
|
|
34
15
|
|
|
35
16
|
return url;
|
|
36
17
|
}
|
|
37
18
|
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
urlFromFirstLastChildNode(context) {
|
|
20
|
+
const url = this.fromFirstLastChildNode((firstLastChildNode) => {
|
|
21
|
+
const terminalNode = firstLastChildNode, ///
|
|
22
|
+
url = urlFromTerminalNode(terminalNode);
|
|
40
23
|
|
|
41
|
-
|
|
24
|
+
return url;
|
|
25
|
+
});
|
|
42
26
|
|
|
43
|
-
|
|
44
|
-
inlineText = this.fromSecondChildNode((secondChildNode) => {
|
|
45
|
-
const indent = null,
|
|
46
|
-
inlineTextMarkdownNode = secondChildNode, ///
|
|
47
|
-
inlineTextMarkdownNodeHTML = inlineTextMarkdownNode.asHTML(indent, context);
|
|
48
|
-
|
|
49
|
-
inlineText = inlineTextMarkdownNodeHTML; ///
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return inlineText;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
attributeName(context) {
|
|
57
|
-
const attributeName = HREF_ATTRIBUTE_NAME;
|
|
58
|
-
|
|
59
|
-
return attributeName;
|
|
27
|
+
return url;
|
|
60
28
|
}
|
|
61
29
|
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
30
|
+
url(context) {
|
|
31
|
+
const simple = this.isSimple(),
|
|
32
|
+
url = simple ?
|
|
33
|
+
this.urlFromFirstLastChildNode(context) :
|
|
34
|
+
this.urlFromSecondLastChildNode(context);
|
|
65
35
|
|
|
66
|
-
return
|
|
36
|
+
return url;
|
|
67
37
|
}
|
|
68
38
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
content = inlineText; ///
|
|
76
|
-
} else {
|
|
77
|
-
content = this.content(context);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
let domElement;
|
|
81
|
-
|
|
82
|
-
const textNode = document.createTextNode(content);
|
|
83
|
-
|
|
84
|
-
domElement = super.createDOMElement(context);
|
|
85
|
-
|
|
86
|
-
const parentDOMElement = domElement; ///
|
|
39
|
+
isSimple() {
|
|
40
|
+
const simple = this.fromFirstLastChildNode((firstLastChildNode) => {
|
|
41
|
+
const terminalNode = firstLastChildNode, ///
|
|
42
|
+
type = terminalNode.getType(),
|
|
43
|
+
typeURLTokenType = (type === URL_TOKEN_TYPE),
|
|
44
|
+
simple = typeURLTokenType; ///
|
|
87
45
|
|
|
88
|
-
|
|
46
|
+
return simple;
|
|
47
|
+
});
|
|
89
48
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
domElement = parentDOMElement; ///
|
|
93
|
-
|
|
94
|
-
return domElement;
|
|
49
|
+
return simple;
|
|
95
50
|
}
|
|
96
51
|
|
|
97
|
-
|
|
98
|
-
|
|
52
|
+
static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(HyperlinkMarkdownNode, ruleName, childNodes, opacity); }
|
|
53
|
+
}
|
|
99
54
|
|
|
100
|
-
|
|
55
|
+
function urlFromTerminalNode(terminalNode) {
|
|
56
|
+
let url = null;
|
|
101
57
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
} else {
|
|
105
|
-
content = this.content(context);
|
|
106
|
-
}
|
|
58
|
+
const type = terminalNode.getType(),
|
|
59
|
+
typeURLTokenType = (type === URL_TOKEN_TYPE);
|
|
107
60
|
|
|
108
|
-
|
|
61
|
+
if (typeURLTokenType) {
|
|
62
|
+
const content = terminalNode.getContent();
|
|
109
63
|
|
|
110
|
-
|
|
64
|
+
url = content; ///
|
|
111
65
|
}
|
|
112
66
|
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
Object.assign(HyperlinkLinkMarkdownNode.prototype, contentMixins);
|
|
117
|
-
|
|
118
|
-
export default HyperlinkLinkMarkdownNode;
|
|
67
|
+
return url;
|
|
68
|
+
}
|