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 +5 -5
- package/package.json +1 -1
- package/src/Parser.coffee +3 -3
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
|
-
|
833
|
-
if (
|
834
|
-
suffix = ' 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
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
|
-
|
853
|
+
olStart = parseInt matches[2]
|
854
854
|
|
855
|
-
suffix = ' start="' +
|
855
|
+
suffix = ' start="' + olStart + '"' if olStart != 1
|
856
856
|
|
857
857
|
rows.push [matches[4]]
|
858
858
|
last = rows.length - 1
|