remark-lint/packages/remark-lint-fenced-code-marker
Titus Wormer 4a380fca27 Rewrite so that rules are published to npm individually
Additionally, this updates for remark@7.0.0, unified@6.0.0.
2017-02-23 18:07:52 +01:00
..
index.js Rewrite so that rules are published to npm individually 2017-02-23 18:07:52 +01:00
package.json Rewrite so that rules are published to npm individually 2017-02-23 18:07:52 +01:00
readme.md Rewrite so that rules are published to npm individually 2017-02-23 18:07:52 +01:00

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 `'~'`

License

MIT © Titus Wormer