mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Hook up ESLint, fix warnings (including conversion to async I/O).
This commit is contained in:
parent
d16e1cafc1
commit
160146ac3a
5 changed files with 230 additions and 41 deletions
|
|
@ -3,20 +3,20 @@
|
|||
function padAndTrim(lines) {
|
||||
return [].concat(
|
||||
"",
|
||||
lines.map(function(line) {
|
||||
lines.map(function mapLine(line) {
|
||||
return line.trim();
|
||||
}),
|
||||
"");
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
MD031: function(lines) {
|
||||
"MD031": function MD031(lines) {
|
||||
// Some parsers have trouble detecting fenced code blocks without
|
||||
// surrounding whitespace, so examine the lines directly.
|
||||
lines = padAndTrim(lines);
|
||||
var errors = [];
|
||||
var inCode = false;
|
||||
lines.forEach(function(line, lineNum) {
|
||||
lines.forEach(function forLine(line, lineNum) {
|
||||
if (line.match(/^(```|~~~)/)) {
|
||||
inCode = !inCode;
|
||||
if ((inCode && lines[lineNum - 1].length) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue