hyperdown 2.4.28 → 2.4.30

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/Parser.js CHANGED
@@ -583,7 +583,7 @@
583
583
 
584
584
  parseBlockTable(block, key, line, state, lines) {
585
585
  var align, aligns, head, j, len, matches, row, rows;
586
- if (!!(matches = line.match(/^((?:(?:(?:\||\+)(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:[ :]*\-+[ :]*)(?:\||\+)(?:[ :]*\-+[ :]*))|(?:(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:\||\+)(?:[ :]*\-+[ :]*)))+)$/))) {
586
+ if (!!(matches = line.match(/^\s*(\|?[ :]*-+[ :]*(?:\|[ :]*-+[ :]*)*\|?)\s*$/))) {
587
587
  if (this.isBlock('table')) {
588
588
  block[3][0].push(block[3][2]);
589
589
  block[3][2] += 1;
@@ -819,7 +819,7 @@
819
819
  }
820
820
 
821
821
  parseList(lines, value, start) {
822
- var html, j, key, l, last, len, len1, line, matches, row, rows, space, suffix, tab, type;
822
+ var html, j, key, l, last, len, len1, line, matches, olStart, row, rows, space, suffix, tab, type;
823
823
  html = '';
824
824
  [space, type, tab] = value;
825
825
  rows = [];
@@ -829,9 +829,9 @@
829
829
  line = lines[key];
830
830
  if (matches = line.match(new RegExp(`^(\\s{${space}})((?:[0-9]+\\.?)|\\-|\\+|\\*)(\\s+)(.*)$`))) {
831
831
  if (type === 'ol' && key === 0) {
832
- start = parseInt(matches[2]);
833
- if (start !== 1) {
834
- suffix = ' start="' + start + '"';
832
+ olStart = parseInt(matches[2]);
833
+ if (olStart !== 1) {
834
+ suffix = ' start="' + olStart + '"';
835
835
  }
836
836
  }
837
837
  rows.push([matches[4]]);
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "BSD-4-Clause",
9
9
  "author": "SegmentFault",
10
- "version": "2.4.28",
10
+ "version": "2.4.30",
11
11
  "scripts": {
12
12
  "test": "mocha",
13
13
  "build": "cake build"
package/src/Parser.coffee CHANGED
@@ -613,7 +613,7 @@ class Parser
613
613
 
614
614
 
615
615
  parseBlockTable: (block, key, line, state, lines) ->
616
- if !!(matches = line.match /^((?:(?:(?:\||\+)(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:[ :]*\-+[ :]*)(?:\||\+)(?:[ :]*\-+[ :]*))|(?:(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:\||\+)(?:[ :]*\-+[ :]*)))+)$/)
616
+ if !!(matches = line.match /^\s*(\|?[ :]*-+[ :]*(?:\|[ :]*-+[ :]*)*\|?)\s*$/)
617
617
  if @isBlock 'table'
618
618
  block[3][0].push block[3][2]
619
619
  block[3][2] += 1
@@ -850,9 +850,9 @@ class Parser
850
850
  for line, key in lines
851
851
  if matches = line.match new RegExp "^(\\s{#{space}})((?:[0-9]+\\.?)|\\-|\\+|\\*)(\\s+)(.*)$"
852
852
  if type is 'ol' and key is 0
853
- start = parseInt matches[2]
853
+ olStart = parseInt matches[2]
854
854
 
855
- suffix = ' start="' + start + '"' if start != 1
855
+ suffix = ' start="' + olStart + '"' if olStart != 1
856
856
 
857
857
  rows.push [matches[4]]
858
858
  last = rows.length - 1