@honkit/markup-it 5.0.0 → 5.1.1

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.
@@ -20,5 +20,5 @@ exports.default = {
20
20
  TABLE_CELL: "table_cell",
21
21
  OL_LIST: "ordered_list",
22
22
  UL_LIST: "unordered_list",
23
- LIST_ITEM: "list_item",
23
+ LIST_ITEM: "list_item"
24
24
  };
@@ -9,7 +9,7 @@ const styles_1 = __importDefault(require("./styles"));
9
9
  const defaultDocumentRule = (0, rule_1.default)(blocks_1.default.DOCUMENT)
10
10
  .match((state, text) => {
11
11
  return {
12
- tokens: state.parseAsBlock(text),
12
+ tokens: state.parseAsBlock(text)
13
13
  };
14
14
  })
15
15
  .toText((state, token) => {
@@ -18,19 +18,19 @@ const defaultDocumentRule = (0, rule_1.default)(blocks_1.default.DOCUMENT)
18
18
  const defaultBlockRule = (0, rule_1.default)(blocks_1.default.TEXT)
19
19
  .match((state, text) => {
20
20
  return {
21
- tokens: state.parseAsInline(text),
21
+ tokens: state.parseAsInline(text)
22
22
  };
23
23
  })
24
24
  .toText("%s\n");
25
25
  const defaultInlineRule = (0, rule_1.default)(styles_1.default.TEXT)
26
26
  .match((state, text) => {
27
27
  return {
28
- text: text,
28
+ text: text
29
29
  };
30
30
  })
31
31
  .toText("%s");
32
32
  exports.default = {
33
33
  documentRule: defaultDocumentRule,
34
34
  blockRule: defaultBlockRule,
35
- inlineRule: defaultInlineRule,
35
+ inlineRule: defaultInlineRule
36
36
  };
@@ -6,5 +6,5 @@ exports.default = {
6
6
  FOOTNOTE_REF: "footnote-ref",
7
7
  // HonKit specifics
8
8
  MATH: "math",
9
- TEMPLATE: "template",
9
+ TEMPLATE: "template"
10
10
  };
@@ -6,5 +6,5 @@ exports.default = {
6
6
  ITALIC: "ITALIC",
7
7
  CODE: "CODE",
8
8
  STRIKETHROUGH: "STRIKETHROUGH",
9
- HTML: "HTML",
9
+ HTML: "HTML"
10
10
  };
@@ -19,7 +19,7 @@ function decodeTokenFromJSON(json) {
19
19
  text: json.text,
20
20
  raw: json.raw,
21
21
  data: json.data,
22
- tokens: decodeTokensFromJSON(json.tokens || []),
22
+ tokens: decodeTokensFromJSON(json.tokens || [])
23
23
  });
24
24
  }
25
25
  /**
@@ -24,7 +24,7 @@ function encodeTokenToJSON(token) {
24
24
  type: token.getType(),
25
25
  text: token.getText(),
26
26
  data: encodeDataToJSON(token.getData()),
27
- tokens: encodeTokensToJSON(token.getTokens()),
27
+ tokens: encodeTokensToJSON(token.getTokens())
28
28
  };
29
29
  }
30
30
  /**
@@ -45,7 +45,7 @@ function encodeTokensToJSON(tokens) {
45
45
  function encodeContentToJSON(content) {
46
46
  return {
47
47
  syntax: content.getSyntax(),
48
- token: encodeTokenToJSON(content.getToken()),
48
+ token: encodeTokenToJSON(content.getToken())
49
49
  };
50
50
  }
51
51
  exports.default = encodeContentToJSON;
package/lib/json/index.js CHANGED
@@ -7,5 +7,5 @@ const encode_1 = __importDefault(require("./encode"));
7
7
  const decode_1 = __importDefault(require("./decode"));
8
8
  exports.default = {
9
9
  encode: encode_1.default,
10
- decode: decode_1.default,
10
+ decode: decode_1.default
11
11
  };
@@ -11,7 +11,7 @@ const Content = immutable_1.default.Record({
11
11
  syntax: String(),
12
12
  // Entry token
13
13
  // @ts-ignore
14
- token: token_1.default.create(blocks_1.default.DOCUMENT),
14
+ token: token_1.default.create(blocks_1.default.DOCUMENT)
15
15
  });
16
16
  // ---- GETTERS ----
17
17
  Content.prototype.getSyntax = function () {
@@ -31,7 +31,7 @@ Content.prototype.getToken = function () {
31
31
  Content.createFromToken = function (syntax, token) {
32
32
  return new Content({
33
33
  syntax: syntax,
34
- token: token,
34
+ token: token
35
35
  });
36
36
  };
37
37
  exports.default = Content;
@@ -11,7 +11,7 @@ const RuleRecord = immutable_1.default.Record({
11
11
  // Type of the rule
12
12
  type: new String(),
13
13
  // Listener / Handlers {Map(<String,List<Function>)}
14
- listeners: immutable_1.default.Map(),
14
+ listeners: immutable_1.default.Map()
15
15
  });
16
16
  function Rule(type) {
17
17
  if (!(this instanceof Rule)) {
@@ -19,7 +19,7 @@ function Rule(type) {
19
19
  return new Rule(type);
20
20
  }
21
21
  RuleRecord.call(this, {
22
- type: type,
22
+ type: type
23
23
  });
24
24
  }
25
25
  inherits(Rule, RuleRecord);
@@ -8,7 +8,7 @@ const is_1 = __importDefault(require("is"));
8
8
  const rule_1 = __importDefault(require("./rule"));
9
9
  const inherits = require("util").inherits;
10
10
  const RulesSetRecord = immutable_1.default.Record({
11
- rules: immutable_1.default.List(),
11
+ rules: immutable_1.default.List()
12
12
  });
13
13
  function RulesSet(rules) {
14
14
  if (!(this instanceof RulesSet)) {
@@ -18,7 +18,7 @@ function RulesSet(rules) {
18
18
  // @ts-ignore
19
19
  rules = new RulesList(rules);
20
20
  RulesSetRecord.call(this, {
21
- rules: rules,
21
+ rules: rules
22
22
  });
23
23
  }
24
24
  inherits(RulesSet, RulesSetRecord);
@@ -15,7 +15,7 @@ const SyntaxSetRecord = immutable_1.default.Record({
15
15
  // @ts-ignore
16
16
  inline: new rules_1.default([]),
17
17
  // @ts-ignore
18
- blocks: new rules_1.default([]),
18
+ blocks: new rules_1.default([])
19
19
  });
20
20
  function SyntaxSet(name, def) {
21
21
  if (!(this instanceof SyntaxSet)) {
@@ -28,7 +28,7 @@ function SyntaxSet(name, def) {
28
28
  // @ts-ignore
29
29
  inline: new rules_1.default(def.inline),
30
30
  // @ts-ignore
31
- blocks: new rules_1.default(def.blocks),
31
+ blocks: new rules_1.default(def.blocks)
32
32
  });
33
33
  }
34
34
  inherits(SyntaxSet, SyntaxSetRecord);
@@ -20,7 +20,7 @@ const TokenRecord = immutable_1.default.Record({
20
20
  // Can be use for annotating
21
21
  raw: String(),
22
22
  // List of children tokens (for block tokens)
23
- tokens: immutable_1.default.List(),
23
+ tokens: immutable_1.default.List()
24
24
  });
25
25
  function Token(def) {
26
26
  if (!(this instanceof Token)) {
@@ -32,7 +32,7 @@ function Token(def) {
32
32
  data: immutable_1.default.Map(def.data),
33
33
  text: def.text,
34
34
  raw: def.raw,
35
- tokens: immutable_1.default.List(def.tokens),
35
+ tokens: immutable_1.default.List(def.tokens)
36
36
  });
37
37
  }
38
38
  inherits(Token, TokenRecord);
@@ -91,7 +91,7 @@ Token.prototype.mergeWith = function (token) {
91
91
  text: this.getText() + token.getText(),
92
92
  raw: this.getRaw() + token.getRaw(),
93
93
  data: this.getData().merge(token.getData()),
94
- tokens: this.getTokens().concat(token.getTokens()),
94
+ tokens: this.getTokens().concat(token.getTokens())
95
95
  });
96
96
  };
97
97
  /**
@@ -101,7 +101,7 @@ Token.prototype.mergeWith = function (token) {
101
101
  */
102
102
  Token.prototype.pushToken = function (token) {
103
103
  return this.merge({
104
- tokens: this.getTokens().push(token),
104
+ tokens: this.getTokens().push(token)
105
105
  });
106
106
  };
107
107
  /**
@@ -145,7 +145,7 @@ Token.create = function (type, tok) {
145
145
  text: text,
146
146
  raw: tok.raw || "",
147
147
  tokens: tokens,
148
- data: data,
148
+ data: data
149
149
  });
150
150
  };
151
151
  /**
@@ -156,7 +156,7 @@ Token.create = function (type, tok) {
156
156
  Token.createText = function (text) {
157
157
  return Token.create(styles_1.default.TEXT, {
158
158
  text: text,
159
- raw: text,
159
+ raw: text
160
160
  });
161
161
  };
162
162
  exports.default = Token;
@@ -8,7 +8,7 @@ const RenderOptions = immutable_1.default.Record({
8
8
  // Transform the output of the render of a token
9
9
  annotate: function (state, raw, token) {
10
10
  return raw;
11
- },
11
+ }
12
12
  });
13
13
  RenderOptions.prototype.getAnnotateFn = function () {
14
14
  return this.get("annotate");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honkit/markup-it",
3
- "version": "5.0.0",
3
+ "version": "5.1.1",
4
4
  "description": "Pipeline for working with markup input (for example Markdown)",
5
5
  "keywords": [
6
6
  "draft-js",
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "9feb7e251f1d305c2cd521f78f0a275b847a6e1b"
55
+ "gitHead": "07b261ffa95c4b3dec020657aa09a1db034edd15"
56
56
  }
@@ -58,5 +58,5 @@ module.exports = [
58
58
  }
59
59
 
60
60
  return `<pre><code${attr}>${utils.escape(text)}</code></pre>\n`;
61
- }),
61
+ })
62
62
  ];
@@ -4,7 +4,7 @@ const htmlToTokens = require("./parse");
4
4
  const documentRule = MarkupIt.Rule(MarkupIt.BLOCKS.DOCUMENT)
5
5
  .match((state, text) => {
6
6
  return {
7
- tokens: htmlToTokens(text),
7
+ tokens: htmlToTokens(text)
8
8
  };
9
9
  })
10
10
  .toText((state, token) => {
@@ -18,5 +18,5 @@ module.exports = MarkupIt.Syntax("html", {
18
18
  inline: require("./inline"),
19
19
 
20
20
  // List of rules for parsing inline styles/entities
21
- blocks: require("./blocks"),
21
+ blocks: require("./blocks")
22
22
  });
@@ -30,7 +30,7 @@ module.exports = [
30
30
  HTMLRule(markup.ENTITIES.LINK, "a", (data) => {
31
31
  return {
32
32
  title: data.title ? utils.escape(data.title) : undefined,
33
- href: utils.escape(data.href || ""),
33
+ href: utils.escape(data.href || "")
34
34
  };
35
35
  }),
36
36
 
@@ -43,5 +43,5 @@ module.exports = [
43
43
  // ---- HTML ----
44
44
  markup.Rule(markup.STYLES.HTML).toText((state, token) => {
45
45
  return token.getAsPlainText();
46
- }),
46
+ })
47
47
  ];
@@ -25,5 +25,5 @@ const ruleUL = MarkupIt.Rule(MarkupIt.BLOCKS.UL_LIST).toText(renderListItem);
25
25
 
26
26
  module.exports = {
27
27
  ol: ruleOL,
28
- ul: ruleUL,
28
+ ul: ruleUL
29
29
  };
@@ -28,12 +28,12 @@ const TAGS_TO_TYPE = {
28
28
  b: MarkupIt.STYLES.BOLD,
29
29
  strike: MarkupIt.STYLES.STRIKETHROUGH,
30
30
  em: MarkupIt.STYLES.ITALIC,
31
- code: MarkupIt.STYLES.CODE,
31
+ code: MarkupIt.STYLES.CODE
32
32
  };
33
33
 
34
34
  function resolveHeadingAttrs(attribs) {
35
35
  return {
36
- id: attribs.id,
36
+ id: attribs.id
37
37
  };
38
38
  }
39
39
 
@@ -41,13 +41,13 @@ const TAGS_TO_DATA = {
41
41
  a: function (attribs) {
42
42
  return {
43
43
  href: attribs.href,
44
- title: attribs.alt || "",
44
+ title: attribs.alt || ""
45
45
  };
46
46
  },
47
47
  img: function (attribs) {
48
48
  return {
49
49
  src: attribs.src,
50
- title: attribs.alt || "",
50
+ title: attribs.alt || ""
51
51
  };
52
52
  },
53
53
  h1: resolveHeadingAttrs,
@@ -55,7 +55,7 @@ const TAGS_TO_DATA = {
55
55
  h3: resolveHeadingAttrs,
56
56
  h4: resolveHeadingAttrs,
57
57
  h5: resolveHeadingAttrs,
58
- h6: resolveHeadingAttrs,
58
+ h6: resolveHeadingAttrs
59
59
  };
60
60
 
61
61
  /**
@@ -86,7 +86,7 @@ function htmlToTokens(str) {
86
86
  }
87
87
 
88
88
  const token = MarkupIt.Token.create(type, {
89
- data: dataResolver ? dataResolver(attribs) : {},
89
+ data: dataResolver ? dataResolver(attribs) : {}
90
90
  });
91
91
 
92
92
  stack.push(token);
@@ -107,10 +107,10 @@ function htmlToTokens(str) {
107
107
 
108
108
  const lastToken = stack.pop();
109
109
  pushToLast(lastToken);
110
- },
110
+ }
111
111
  },
112
112
  {
113
- decodeEntities: true,
113
+ decodeEntities: true
114
114
  }
115
115
  );
116
116
 
@@ -42,5 +42,5 @@ const cellRule = MarkupIt.Rule(MarkupIt.BLOCKS.TABLE_CELL).toText((state, token)
42
42
  module.exports = {
43
43
  block: blockRule,
44
44
  row: rowRule,
45
- cell: cellRule,
45
+ cell: cellRule
46
46
  };
@@ -21,5 +21,5 @@ function unescape(str) {
21
21
 
22
22
  module.exports = {
23
23
  escape: escape,
24
- unescape: unescape,
24
+ unescape: unescape
25
25
  };
@@ -19,8 +19,8 @@ module.exports = MarkupIt.RulesSet([
19
19
  return {
20
20
  tokens: state.parseAsInline(text),
21
21
  data: {
22
- id: match[1],
23
- },
22
+ id: match[1]
23
+ }
24
24
  };
25
25
  })
26
26
  .toText((state, token) => {
@@ -58,7 +58,7 @@ module.exports = MarkupIt.RulesSet([
58
58
 
59
59
  return state.toggle("blockquote", () => {
60
60
  return {
61
- tokens: state.parseAsBlock(inner),
61
+ tokens: state.parseAsBlock(inner)
62
62
  };
63
63
  });
64
64
  })
@@ -82,7 +82,7 @@ module.exports = MarkupIt.RulesSet([
82
82
  MarkupIt.Rule(MarkupIt.BLOCKS.HTML)
83
83
  .regExp(reBlock.html, (state, match) => {
84
84
  return {
85
- text: match[0],
85
+ text: match[0]
86
86
  };
87
87
  })
88
88
  .toText("%s"),
@@ -100,11 +100,11 @@ module.exports = MarkupIt.RulesSet([
100
100
  state.refs = state.refs || {};
101
101
  state.refs[id] = {
102
102
  href: href,
103
- title: title,
103
+ title: title
104
104
  };
105
105
 
106
106
  return {
107
- type: "definition",
107
+ type: "definition"
108
108
  };
109
109
  }),
110
110
 
@@ -121,10 +121,10 @@ module.exports = MarkupIt.RulesSet([
121
121
  tokens: [
122
122
  MarkupIt.Token.create(MarkupIt.ENTITIES.MATH, {
123
123
  data: {
124
- tex: text,
125
- },
126
- }),
127
- ],
124
+ tex: text
125
+ }
126
+ })
127
+ ]
128
128
  };
129
129
  })
130
130
  .regExp(reBlock.paragraph, (state, match) => {
@@ -138,7 +138,7 @@ module.exports = MarkupIt.RulesSet([
138
138
  const text = match[1].trim();
139
139
 
140
140
  return {
141
- tokens: state.parseAsInline(text),
141
+ tokens: state.parseAsInline(text)
142
142
  };
143
143
  })
144
144
  .toText("%s\n\n"),
@@ -150,8 +150,8 @@ module.exports = MarkupIt.RulesSet([
150
150
  const text = match[0];
151
151
 
152
152
  return {
153
- tokens: state.parseAsInline(text),
153
+ tokens: state.parseAsInline(text)
154
154
  };
155
155
  })
156
- .toText("%s\n"),
156
+ .toText("%s\n")
157
157
  ]);
@@ -12,8 +12,8 @@ const blockRule = MarkupIt.Rule(MarkupIt.BLOCKS.CODE)
12
12
  tokens: [MarkupIt.Token.createText(inner)],
13
13
  data: {
14
14
  syntax: match[2],
15
- type: "fences", // https://spec.commonmark.org/0.29/#fenced-code-blocks
16
- },
15
+ type: "fences" // https://spec.commonmark.org/0.29/#fenced-code-blocks
16
+ }
17
17
  };
18
18
  })
19
19
 
@@ -28,8 +28,8 @@ const blockRule = MarkupIt.Rule(MarkupIt.BLOCKS.CODE)
28
28
  tokens: [MarkupIt.Token.createText(inner)],
29
29
  data: {
30
30
  syntax: undefined,
31
- type: "indented", // https://spec.commonmark.org/0.29/#indented-code-blocks
32
- },
31
+ type: "indented" // https://spec.commonmark.org/0.29/#indented-code-blocks
32
+ }
33
33
  };
34
34
  })
35
35
 
@@ -60,5 +60,5 @@ const blockRule = MarkupIt.Rule(MarkupIt.BLOCKS.CODE)
60
60
  });
61
61
 
62
62
  module.exports = {
63
- block: blockRule,
63
+ block: blockRule
64
64
  };
@@ -64,7 +64,7 @@ const documentRule = MarkupIt.Rule(MarkupIt.BLOCKS.DOCUMENT)
64
64
  text = cleanupText(text);
65
65
 
66
66
  const token = MarkupIt.Token.create(MarkupIt.BLOCKS.DOCUMENT, {
67
- tokens: state.parseAsBlock(text),
67
+ tokens: state.parseAsBlock(text)
68
68
  });
69
69
 
70
70
  return MarkupIt.transform(token, resolveLink.bind(null, state));
@@ -21,8 +21,8 @@ function parseHeadingText(state, text) {
21
21
  return {
22
22
  tokens: state.parseAsInline(text),
23
23
  data: {
24
- id: id,
25
- },
24
+ id: id
25
+ }
26
26
  };
27
27
  }
28
28
 
@@ -7,5 +7,5 @@ module.exports = MarkupIt.Syntax("markdown", {
7
7
  inline: require("./inline"),
8
8
 
9
9
  // List of rules for parsing inline styles/entities
10
- blocks: require("./blocks"),
10
+ blocks: require("./blocks")
11
11
  });
@@ -12,7 +12,7 @@ const inlineRules = MarkupIt.RulesSet([
12
12
  MarkupIt.Rule(MarkupIt.ENTITIES.FOOTNOTE_REF)
13
13
  .regExp(reInline.reffn, (state, match) => {
14
14
  return {
15
- text: match[1],
15
+ text: match[1]
16
16
  };
17
17
  })
18
18
  .toText((state, token) => {
@@ -29,7 +29,7 @@ const inlineRules = MarkupIt.RulesSet([
29
29
 
30
30
  const imgData = {
31
31
  alt: match[1],
32
- src: match[2],
32
+ src: match[2]
33
33
  };
34
34
 
35
35
  const title = match[3];
@@ -38,7 +38,7 @@ const inlineRules = MarkupIt.RulesSet([
38
38
  }
39
39
 
40
40
  return {
41
- data: imgData,
41
+ data: imgData
42
42
  };
43
43
  })
44
44
  .toText((state, token) => {
@@ -61,8 +61,8 @@ const inlineRules = MarkupIt.RulesSet([
61
61
  tokens: state.parseAsInline(match[1]),
62
62
  data: {
63
63
  href: match[2],
64
- title: match[3],
65
- },
64
+ title: match[3]
65
+ }
66
66
  };
67
67
  });
68
68
  })
@@ -71,8 +71,8 @@ const inlineRules = MarkupIt.RulesSet([
71
71
  return {
72
72
  tokens: state.parseAsInline(match[1]),
73
73
  data: {
74
- href: match[1],
75
- },
74
+ href: match[1]
75
+ }
76
76
  };
77
77
  });
78
78
  })
@@ -84,9 +84,9 @@ const inlineRules = MarkupIt.RulesSet([
84
84
 
85
85
  return {
86
86
  data: {
87
- href: uri,
87
+ href: uri
88
88
  },
89
- tokens: [MarkupIt.Token.createText(uri)],
89
+ tokens: [MarkupIt.Token.createText(uri)]
90
90
  };
91
91
  })
92
92
  .regExp(reInline.reflink, (state, match) => {
@@ -97,9 +97,9 @@ const inlineRules = MarkupIt.RulesSet([
97
97
  return {
98
98
  type: MarkupIt.ENTITIES.LINK,
99
99
  data: {
100
- ref: refId,
100
+ ref: refId
101
101
  },
102
- tokens: [MarkupIt.Token.createText(innerText)],
102
+ tokens: [MarkupIt.Token.createText(innerText)]
103
103
  };
104
104
  });
105
105
  })
@@ -111,8 +111,8 @@ const inlineRules = MarkupIt.RulesSet([
111
111
  type: MarkupIt.ENTITIES.LINK,
112
112
  tokens: state.parseAsInline(match[1]),
113
113
  data: {
114
- ref: refId,
115
- },
114
+ ref: refId
115
+ }
116
116
  };
117
117
  });
118
118
  })
@@ -123,8 +123,8 @@ const inlineRules = MarkupIt.RulesSet([
123
123
  return {
124
124
  tokens: state.parseAsInline(match[1]),
125
125
  data: {
126
- ref: refId,
127
- },
126
+ ref: refId
127
+ }
128
128
  };
129
129
  });
130
130
  })
@@ -142,7 +142,7 @@ const inlineRules = MarkupIt.RulesSet([
142
142
  MarkupIt.Rule(MarkupIt.STYLES.CODE)
143
143
  .regExp(reInline.code, (state, match) => {
144
144
  return {
145
- tokens: [MarkupIt.Token.createText(match[2])],
145
+ tokens: [MarkupIt.Token.createText(match[2])]
146
146
  };
147
147
  })
148
148
  .toText((state, token) => {
@@ -161,7 +161,7 @@ const inlineRules = MarkupIt.RulesSet([
161
161
  MarkupIt.Rule(MarkupIt.STYLES.BOLD)
162
162
  .regExp(reInline.strong, (state, match) => {
163
163
  return {
164
- tokens: state.parseAsInline(match[2] || match[1]),
164
+ tokens: state.parseAsInline(match[2] || match[1])
165
165
  };
166
166
  })
167
167
  .toText("**%s**"),
@@ -170,7 +170,7 @@ const inlineRules = MarkupIt.RulesSet([
170
170
  MarkupIt.Rule(MarkupIt.STYLES.ITALIC)
171
171
  .regExp(reInline.em, (state, match) => {
172
172
  return {
173
- tokens: state.parseAsInline(match[2] || match[1]),
173
+ tokens: state.parseAsInline(match[2] || match[1])
174
174
  };
175
175
  })
176
176
  .toText("_%s_"),
@@ -179,7 +179,7 @@ const inlineRules = MarkupIt.RulesSet([
179
179
  MarkupIt.Rule(MarkupIt.STYLES.STRIKETHROUGH)
180
180
  .regExp(reInline.del, (state, match) => {
181
181
  return {
182
- tokens: state.parseAsInline(match[1]),
182
+ tokens: state.parseAsInline(match[1])
183
183
  };
184
184
  })
185
185
  .toText("~~%s~~"),
@@ -212,15 +212,15 @@ const inlineRules = MarkupIt.RulesSet([
212
212
  {
213
213
  type: MarkupIt.STYLES.HTML,
214
214
  text: innerText,
215
- raw: innerText,
216
- },
215
+ raw: innerText
216
+ }
217
217
  ];
218
218
  }
219
219
 
220
220
  let result = Immutable.List().push({
221
221
  type: MarkupIt.STYLES.HTML,
222
222
  text: startTag,
223
- raw: startTag,
223
+ raw: startTag
224
224
  });
225
225
 
226
226
  result = result.concat(innerTokens);
@@ -229,7 +229,7 @@ const inlineRules = MarkupIt.RulesSet([
229
229
  result = result.push({
230
230
  type: MarkupIt.STYLES.HTML,
231
231
  text: endTag,
232
- raw: endTag,
232
+ raw: endTag
233
233
  });
234
234
  }
235
235
 
@@ -258,9 +258,9 @@ const inlineRules = MarkupIt.RulesSet([
258
258
  return {
259
259
  text: "",
260
260
  data: {
261
- type: type,
261
+ type: type
262
262
  },
263
- tokens: [MarkupIt.Token.createText(text)],
263
+ tokens: [MarkupIt.Token.createText(text)]
264
264
  };
265
265
  })
266
266
  .toText((state, token) => {
@@ -279,18 +279,18 @@ const inlineRules = MarkupIt.RulesSet([
279
279
  MarkupIt.Rule(MarkupIt.STYLES.TEXT)
280
280
  .regExp(reInline.escape, (state, match) => {
281
281
  return {
282
- text: match[1],
282
+ text: match[1]
283
283
  };
284
284
  })
285
285
  .regExp(reInline.text, (state, match) => {
286
286
  return {
287
- text: utils.unescape(match[0]),
287
+ text: utils.unescape(match[0])
288
288
  };
289
289
  })
290
290
  .toText((state, token) => {
291
291
  const text = token.getAsPlainText();
292
292
  return utils.escape(text, false);
293
- }),
293
+ })
294
294
  ]);
295
295
 
296
296
  module.exports = inlineRules;
@@ -64,7 +64,7 @@ const htmlBlocks = Immutable.List([
64
64
  "title",
65
65
  "tr",
66
66
  "track",
67
- "ul",
67
+ "ul"
68
68
  ]);
69
69
 
70
70
  /**
@@ -66,8 +66,8 @@ function listRule(type) {
66
66
  raw: rawItem,
67
67
  tokens: state.parseAsBlock(textItem),
68
68
  data: {
69
- loose: loose,
70
- },
69
+ loose: loose
70
+ }
71
71
  });
72
72
  };
73
73
 
@@ -75,7 +75,7 @@ function listRule(type) {
75
75
  }
76
76
 
77
77
  return {
78
- tokens: result,
78
+ tokens: result
79
79
  };
80
80
  })
81
81
  .toText((state, token) => {
@@ -109,5 +109,5 @@ function listRule(type) {
109
109
 
110
110
  module.exports = {
111
111
  ul: listRule(MarkupIt.BLOCKS.UL_LIST),
112
- ol: listRule(MarkupIt.BLOCKS.OL_LIST),
112
+ ol: listRule(MarkupIt.BLOCKS.OL_LIST)
113
113
  };
@@ -17,7 +17,7 @@ function isInlineTex(content) {
17
17
  function normalizeTeX(content, isInline) {
18
18
  // trim new line at start and end, but preserve spaces
19
19
  content = content.replace(/^\n+/, "").replace(/\n+$/, "");
20
-
20
+
21
21
  if (!isInline) {
22
22
  content = `\n${content}\n`;
23
23
  }
@@ -34,8 +34,8 @@ module.exports = MarkupIt.Rule(MarkupIt.ENTITIES.MATH)
34
34
 
35
35
  return {
36
36
  data: {
37
- tex: text,
38
- },
37
+ tex: text
38
+ }
39
39
  };
40
40
  })
41
41
  .toText((state, token) => {
@@ -21,8 +21,8 @@ const block = {
21
21
  bullet_ul: /(?:\d+\.)/,
22
22
  bullet_ol: /(?:[*+-])/,
23
23
 
24
- bulletAndSpaces: /^ *([*+-]|\d+\.) +/,
25
- },
24
+ bulletAndSpaces: /^ *([*+-]|\d+\.) +/
25
+ }
26
26
  };
27
27
 
28
28
  const _tag =
@@ -6,7 +6,7 @@ const heading = {
6
6
  line: /^([^\n]+)\n *(=|-){2,} *(?:\n|$)/,
7
7
 
8
8
  // ID in heading
9
- id: /({#)(.+)(})/g,
9
+ id: /({#)(.+)(})/g
10
10
  };
11
11
 
12
12
  module.exports = heading;
@@ -16,7 +16,7 @@ const inline = {
16
16
  del: /^~~(?=\S)([\s\S]*?\S)~~/,
17
17
  text: /^[\s\S]+?(?=[\\<![_*`$]| {2,}\n|$)/,
18
18
  math: /^\$\$([^$]+)\$\$/,
19
- template: /^{([#%{])\s*(.*?)\s*(?=[#%}]})[#%}]}/,
19
+ template: /^{([#%{])\s*(.*?)\s*(?=[#%}]})[#%}]}/
20
20
  };
21
21
 
22
22
  inline._inside = /(?:\[[^\]]*]|[^[\]]|](?=[^[]*]))*/;
@@ -27,7 +27,7 @@ const table = {
27
27
  // Alignements
28
28
  alignRight: /^ *-+: *$/,
29
29
  alignCenter: /^ *:-+: *$/,
30
- alignLeft: /^ *:-+ *$/,
30
+ alignLeft: /^ *:-+ *$/
31
31
  };
32
32
 
33
33
  table.cellSeparation = replace(table.cellSeparation)(/pipe/g, pipe)();
@@ -7,7 +7,7 @@ const tableRow = require("./tableRow");
7
7
  const ALIGN = {
8
8
  LEFT: "left",
9
9
  RIGHT: "right",
10
- CENTER: "center",
10
+ CENTER: "center"
11
11
  };
12
12
 
13
13
  /**
@@ -27,9 +27,9 @@ function Table(state, header, align, rows) {
27
27
 
28
28
  return {
29
29
  data: {
30
- align: align,
30
+ align: align
31
31
  },
32
- tokens: Immutable.List([headerRow]).concat(rowTokens),
32
+ tokens: Immutable.List([headerRow]).concat(rowTokens)
33
33
  };
34
34
  }
35
35
 
@@ -135,5 +135,5 @@ const cellRule = MarkupIt.Rule(MarkupIt.BLOCKS.TABLE_CELL).toText((state, token)
135
135
  module.exports = {
136
136
  block: blockRule,
137
137
  cell: cellRule,
138
- row: rowRule,
138
+ row: rowRule
139
139
  };
@@ -13,7 +13,7 @@ const rowRules = inlineRules
13
13
  .unshift(
14
14
  MarkupIt.Rule(CELL_SEPARATOR).regExp(reTable.cellSeparation, (match) => {
15
15
  return {
16
- raw: match[0],
16
+ raw: match[0]
17
17
  };
18
18
  })
19
19
  )
@@ -48,7 +48,7 @@ function parseRow(state, text) {
48
48
  }
49
49
 
50
50
  const cell = MarkupIt.Token.create(MarkupIt.BLOCKS.TABLE_CELL, {
51
- tokens: accu,
51
+ tokens: accu
52
52
  });
53
53
 
54
54
  cells.push(cell);
@@ -65,10 +65,10 @@ function parseRow(state, text) {
65
65
  pushCell();
66
66
 
67
67
  return MarkupIt.Token.create(MarkupIt.BLOCKS.TABLE_ROW, {
68
- tokens: cells,
68
+ tokens: cells
69
69
  });
70
70
  }
71
71
 
72
72
  module.exports = {
73
- parse: parseRow,
73
+ parse: parseRow
74
74
  };
@@ -18,7 +18,7 @@ const replacements = [
18
18
  ["<", "&lt;"],
19
19
  [">", "&gt;"],
20
20
  ["_", "\\_"],
21
- ["|", "\\|"],
21
+ ["|", "\\|"]
22
22
  ];
23
23
 
24
24
  // Split a text into lines
@@ -105,5 +105,5 @@ module.exports = {
105
105
  escape: escapeMarkdown,
106
106
  unescape: unescapeMarkdown,
107
107
  replace: replace,
108
- indent: indent,
108
+ indent: indent
109
109
  };