highmark-markdown 0.0.363 → 0.0.365

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.
@@ -41,7 +41,9 @@ const bnf = `
41
41
  ;
42
42
 
43
43
 
44
- directives ::= ( embedDirective
44
+ directives ::= ( pageNumber
45
+
46
+ | embedDirective
45
47
 
46
48
  | ignoreDirective
47
49
 
@@ -49,7 +51,9 @@ const bnf = `
49
51
 
50
52
  | contentsDirective
51
53
 
52
- | footnotesDirective ) ( endOfLine ( embedDirective
54
+ | footnotesDirective ) ( endOfLine ( pageNumber
55
+
56
+ | embedDirective
53
57
 
54
58
  | ignoreDirective
55
59
 
@@ -90,6 +94,9 @@ const bnf = `
90
94
  paragraph ::= line ( endOfLine line )* ;
91
95
 
92
96
 
97
+ pageNumber ::= "@pageNumber" ;
98
+
99
+
93
100
  embedDirective ::= "@embed" [path] ;
94
101
 
95
102
 
@@ -44,7 +44,7 @@ const entries = [
44
44
  "reference": "\\[\\^[a-z]+(?:-[a-z]+)*\\]:"
45
45
  },
46
46
  {
47
- "directive": "@[a-z]+"
47
+ "directive": "@[a-z]+([A-Z][a-z]+)*"
48
48
  },
49
49
  {
50
50
  "identifier": "[a-z]+(?:-[a-z]+)*"
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ import MarkdownNode from "../../../node/markdown";
4
+
5
+ export default class PageNumberDirectiveMarkdownNode extends MarkdownNode {
6
+ content(context) {
7
+ const { pageNumber } = context,
8
+ content = pageNumber;
9
+
10
+ return content;
11
+ }
12
+
13
+ childNodesAsHTML(indent, context) {
14
+ const content = this.content(context),
15
+ childNodesHTML = content; ///
16
+
17
+ return childNodesHTML;
18
+ }
19
+
20
+ createChildNodeDOMElements(context) {
21
+ const content = this.content(context),
22
+ textNode = document.createTextNode(content),
23
+ domElement = textNode; ///
24
+
25
+ this.addDOMElement(domElement);
26
+ }
27
+
28
+ static fromRuleNameChildNodesAndOpacity(ruleName, childNodes, opacity) { return MarkdownNode.fromRuleNameChildNodesAndOpacity(PageNumberDirectiveMarkdownNode, ruleName, childNodes, opacity); }
29
+ }
package/src/nodeMap.js CHANGED
@@ -49,6 +49,7 @@ import BlockListingStartMarkdownNode from "./node/markdown/blockListingStart";
49
49
  import UnorderedListItemMarkdownNode from "./node/markdown/listItem/unordered";
50
50
  import ContentsDirectiveMarkdownNode from "./node/markdown/directive/contents";
51
51
  import FootnotesDirectiveMarkdownNode from "./node/markdown/directive/footnotes";
52
+ import PageNumberDirectiveMarkdownNode from "./node/markdown/directive/pageNumber";
52
53
  import StronglyEmphasisedTextMarkdownNode from "./node/markdown/stronglyEmphasisedText";
53
54
 
54
55
  import { LINE_RULE_NAME,
@@ -100,6 +101,7 @@ import { LINE_RULE_NAME,
100
101
  BLOCK_LISTING_START_RULE_NAME,
101
102
  UNORDERED_LIST_ITEM_RULE_NAME,
102
103
  FOOTNOTES_DIRECTIVE_RULE_NAME,
104
+ PAGE_NUMBER_DIRECTIVE_RULE_NAME,
103
105
  STRONGLY_EMPHASISED_TEXT_RULE_NAME } from "./ruleNames";
104
106
 
105
107
  const nodeMap = {
@@ -152,6 +154,7 @@ const nodeMap = {
152
154
  [BLOCK_LISTING_START_RULE_NAME]: BlockListingStartMarkdownNode,
153
155
  [UNORDERED_LIST_ITEM_RULE_NAME]: UnorderedListItemMarkdownNode,
154
156
  [FOOTNOTES_DIRECTIVE_RULE_NAME]: FootnotesDirectiveMarkdownNode,
157
+ [PAGE_NUMBER_DIRECTIVE_RULE_NAME]: PageNumberDirectiveMarkdownNode,
155
158
  [STRONGLY_EMPHASISED_TEXT_RULE_NAME]: StronglyEmphasisedTextMarkdownNode
156
159
  };
157
160
 
package/src/ruleNames.js CHANGED
@@ -52,6 +52,7 @@ export const CONTENTS_DIRECTIVE_RULE_NAME = "contentsDirective";
52
52
  export const BLOCK_LISTING_START_RULE_NAME = "blockListingStart";
53
53
  export const UNORDERED_LIST_ITEM_RULE_NAME = "unorderedListItem";
54
54
  export const FOOTNOTES_DIRECTIVE_RULE_NAME = "footnotesDirective";
55
+ export const PAGE_NUMBER_DIRECTIVE_RULE_NAME = "pageNumber"; ///
55
56
  export const STRONGLY_EMPHASISED_TEXT_RULE_NAME = "stronglyEmphasisedText";
56
57
 
57
58
  const ruleNames = {
@@ -107,6 +108,7 @@ const ruleNames = {
107
108
  BLOCK_LISTING_START_RULE_NAME,
108
109
  UNORDERED_LIST_ITEM_RULE_NAME,
109
110
  FOOTNOTES_DIRECTIVE_RULE_NAME,
111
+ PAGE_NUMBER_DIRECTIVE_RULE_NAME,
110
112
  STRONGLY_EMPHASISED_TEXT_RULE_NAME
111
113
  };
112
114
 
@@ -19,5 +19,3 @@ export function ruleNamesExpressionFromElementMap(elementMap) {
19
19
 
20
20
  return ruleNamesExpression
21
21
  }
22
-
23
-