update hyperdown

This commit is contained in:
joyqi
2021-09-30 01:06:14 +08:00
parent 5557f6dd91
commit d174cc5732
3 changed files with 8 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@@ -819,7 +819,7 @@
}
parseList(lines, value, start) {
var html, j, key, l, last, len, len1, line, matches, row, rows, space, suffix, tab, type;
var html, j, key, l, last, len, len1, line, matches, olStart, row, rows, space, suffix, tab, type;
html = '';
[space, type, tab] = value;
rows = [];
@@ -829,9 +829,9 @@
line = lines[key];
if (matches = line.match(new RegExp(`^(\\s{${space}})((?:[0-9]+\\.?)|\\-|\\+|\\*)(\\s+)(.*)$`))) {
if (type === 'ol' && key === 0) {
start = parseInt(matches[2]);
if (start !== 1) {
suffix = ' start="' + start + '"';
olStart = parseInt(matches[2]);
if (olStart !== 1) {
suffix = ' start="' + olStart + '"';
}
}
rows.push([matches[4]]);

View File

@@ -1453,10 +1453,10 @@ class HyperDown
foreach ($lines as $key => $line) {
if (preg_match("/^(\s{" . $space . "})((?:[0-9]+\.?)|\-|\+|\*)(\s+)(.*)$/i", $line, $matches)) {
if ($type == 'ol' && $key == 0) {
$start = intval($matches[2]);
$olStart = intval($matches[2]);
if ($start != 1) {
$suffix = ' start="' . $start . '"';
if ($olStart != 1) {
$suffix = ' start="' . $olStart . '"';
}
}