mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-10-28 04:41:50 +03:00
4a380fca27
Additionally, this updates for remark@7.0.0, unified@6.0.0. |
||
---|---|---|
.. | ||
index.js | ||
package.json | ||
readme.md |
remark-lint-fenced-code-marker
Warn for violating fenced code markers.
Options: string
, either '`'
, or '~'
, default: 'consistent'
.
The default value, consistent
, detects the first used fenced code
marker style, and will warn when a subsequent fenced code uses a
different style.
Install
npm install --save remark-lint-fenced-code-marker
Example
When this rule is turned on, the following file
valid.md
is ok:
Indented code blocks are not affected by this rule:
bravo();
When this rule is turned on, the following file
invalid.md
is not ok:
<!-- This is always invalid. -->
```alpha
bravo();
```
~~~
charlie();
~~~
7:1-9:4: Fenced code should use ` as a marker
When this rule is '`'
, the following file
valid.md
is ok:
<!-- This is also valid by default. -->
```alpha
bravo();
```
```
charlie();
```
When this rule is '~'
, the following file
valid.md
is ok:
<!-- This is also valid by default. -->
~~~alpha
bravo();
~~~
~~~
charlie();
~~~
When '!'
is passed in, the following error is given:
1:1: Invalid fenced code marker `!`: use either `'consistent'`, `` '`' ``, or `'~'`