mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-24 09:50:13 +01:00
Add code_blocks parameter to MD010 to ignore hard tabs in code blocks (fixes #31).
This commit is contained in:
parent
c2982e2972
commit
a2df7742c6
6 changed files with 87 additions and 3 deletions
6
test/code-block-with-tabs-allowed.json
Normal file
6
test/code-block-with-tabs-allowed.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"default": true,
|
||||
"MD010": {
|
||||
"code_blocks": false
|
||||
}
|
||||
}
|
||||
35
test/code-block-with-tabs-allowed.md
Normal file
35
test/code-block-with-tabs-allowed.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Heading
|
||||
|
||||
```js
|
||||
if (true) {
|
||||
console.log("true");
|
||||
if (false) {
|
||||
console.log("false");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
if (true) {
|
||||
console.log("true");
|
||||
if (false) {
|
||||
console.log("false");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
if (true) {
|
||||
console.log("true");
|
||||
if (false) {
|
||||
console.log("false");
|
||||
}
|
||||
}
|
||||
|
||||
if (true) {
|
||||
console.log("true");
|
||||
if (false) {
|
||||
console.log("false");
|
||||
}
|
||||
}
|
||||
|
||||
Line with hard tab. {MD010}
|
||||
35
test/code-block-with-tabs.md
Normal file
35
test/code-block-with-tabs.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Heading
|
||||
|
||||
```js
|
||||
if (true) {
|
||||
console.log("true");
|
||||
if (false) {
|
||||
console.log("false");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
if (true) {
|
||||
console.log("true"); // {MD010}
|
||||
if (false) { // {MD010}
|
||||
console.log("false"); // {MD010}
|
||||
} // {MD010}
|
||||
}
|
||||
```
|
||||
|
||||
if (true) {
|
||||
console.log("true");
|
||||
if (false) {
|
||||
console.log("false");
|
||||
}
|
||||
}
|
||||
|
||||
if (true) { // {MD010}
|
||||
console.log("true"); // {MD010}
|
||||
if (false) { // {MD010}
|
||||
console.log("false"); // {MD010}
|
||||
} // {MD010}
|
||||
} // {MD010}
|
||||
|
||||
Line with hard tab. {MD010}
|
||||
|
|
@ -857,7 +857,7 @@ module.exports.readme = function readme(test) {
|
|||
};
|
||||
|
||||
module.exports.doc = function doc(test) {
|
||||
test.expect(293);
|
||||
test.expect(294);
|
||||
fs.readFile("doc/Rules.md", shared.utf8Encoding,
|
||||
function readFile(err, contents) {
|
||||
test.ifError(err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue