mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 19:57:15 +03:00
Rebuild
This commit is contained in:
parent
721c363001
commit
f05670079b
27
doc/rules.md
27
doc/rules.md
@ -861,23 +861,32 @@ be null or undefined in order to be ignored.
|
||||
|
||||
### no-shell-dollars
|
||||
|
||||
```md
|
||||
````md
|
||||
<!-- Invalid: -->
|
||||
$ echo a
|
||||
$ echo a > file
|
||||
```bash
|
||||
$ echo a
|
||||
$ echo a > file
|
||||
```
|
||||
|
||||
<!-- Valid: -->
|
||||
echo a
|
||||
echo a > file
|
||||
```sh
|
||||
echo a
|
||||
echo a > file
|
||||
```
|
||||
|
||||
<!-- Also valid: -->
|
||||
$ echo a
|
||||
a
|
||||
$ echo a > file
|
||||
```
|
||||
```zsh
|
||||
$ echo a
|
||||
a
|
||||
$ echo a > file
|
||||
```
|
||||
````
|
||||
|
||||
Warn when shell code is prefixed by dollar-characters.
|
||||
|
||||
Ignored indented code blocks and fenced code blocks without language
|
||||
flag.
|
||||
|
||||
### no-shortcut-reference-image
|
||||
|
||||
```md
|
||||
|
27
mdast.js
27
mdast.js
@ -3741,19 +3741,28 @@ module.exports = noMultipleToplevelHeadings;
|
||||
* @module no-shell-dollars
|
||||
* @fileoverview
|
||||
* Warn when shell code is prefixed by dollar-characters.
|
||||
*
|
||||
* Ignored indented code blocks and fenced code blocks without language
|
||||
* flag.
|
||||
* @example
|
||||
* <!-- Invalid: -->
|
||||
* $ echo a
|
||||
* $ echo a > file
|
||||
* ```bash
|
||||
* $ echo a
|
||||
* $ echo a > file
|
||||
* ```
|
||||
*
|
||||
* <!-- Valid: -->
|
||||
* echo a
|
||||
* echo a > file
|
||||
* ```sh
|
||||
* echo a
|
||||
* echo a > file
|
||||
* ```
|
||||
*
|
||||
* <!-- Also valid: -->
|
||||
* $ echo a
|
||||
* a
|
||||
* $ echo a > file
|
||||
* ```zsh
|
||||
* $ echo a
|
||||
* a
|
||||
* $ echo a > file
|
||||
* ```
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@ -3799,7 +3808,7 @@ function noShellDollars(ast, file, preferred, done) {
|
||||
var value = node.value;
|
||||
var warn;
|
||||
|
||||
if (position.isGenerated(node)) {
|
||||
if (!language || position.isGenerated(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3807,7 +3816,7 @@ function noShellDollars(ast, file, preferred, done) {
|
||||
* Check both known shell-code and unknown code.
|
||||
*/
|
||||
|
||||
if (!language || flags.indexOf(language) !== -1) {
|
||||
if (flags.indexOf(language) !== -1) {
|
||||
warn = value.length && value.split('\n').every(function (line) {
|
||||
return Boolean(!line.trim() || line.match(/^\s*\$\s*/));
|
||||
});
|
||||
|
2
mdast.min.js
vendored
2
mdast.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user