wikilint 2.6.0 → 2.6.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.
|
@@ -35,9 +35,9 @@ function validate(key, val, config, halfParsed = false, ext) {
|
|
|
35
35
|
case 'manualthumb':
|
|
36
36
|
return true;
|
|
37
37
|
case 'page':
|
|
38
|
-
return (ext === 'djvu' || ext === 'djv') && Number(value) > 0;
|
|
38
|
+
return (ext === 'djvu' || ext === 'djv' || ext === 'pdf') && Number(value) > 0;
|
|
39
39
|
default:
|
|
40
|
-
return !
|
|
40
|
+
return Boolean(value) && !isNaN(value);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
/** 图片参数 */
|
package/dist/src/index.js
CHANGED
|
@@ -128,7 +128,7 @@ class Token extends element_1.AstElement {
|
|
|
128
128
|
if (i % 2 === 0) {
|
|
129
129
|
return new text_1.AstText(s);
|
|
130
130
|
}
|
|
131
|
-
else if (
|
|
131
|
+
else if (isNaN(s.slice(-1))) {
|
|
132
132
|
return this.#accum[Number(s.slice(0, -1))];
|
|
133
133
|
}
|
|
134
134
|
throw new Error(`解析错误!未正确标记的 Token:${s}`);
|
package/dist/src/link/base.js
CHANGED
package/dist/src/table/index.js
CHANGED
|
@@ -60,7 +60,11 @@ class TableToken extends trBase_1.TrBaseToken {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
if (j < length) {
|
|
63
|
-
|
|
63
|
+
const e = (0, lint_1.generateForChild)(this.getNthRow(j), { start }, 'table-layout', 'inconsistent table layout', 'warning');
|
|
64
|
+
e.startIndex++;
|
|
65
|
+
e.startLine++;
|
|
66
|
+
e.startCol = 0;
|
|
67
|
+
errors.push(e);
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
return errors;
|
package/dist/src/table/td.js
CHANGED
|
@@ -127,7 +127,7 @@ class TdToken extends base_1.TableBaseToken {
|
|
|
127
127
|
*/
|
|
128
128
|
getAttr(key) {
|
|
129
129
|
const value = super.getAttr(key);
|
|
130
|
-
return (key === 'rowspan' || key === 'colspan' ?
|
|
130
|
+
return (key === 'rowspan' || key === 'colspan' ? parseInt(value) || 1 : value);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
exports.TdToken = TdToken;
|