Require or disallow metadata for fenced code blocks.
Fenced code blocks can include an info string after the opening fence. The first word typically specifies the language (e.g., js). Many tools also support additional metadata after the language (separated by whitespace), such as titles or line highlighting parameters. This rule enforces a consistent policy for including such metadata.
This rule warns when the presence of metadata in a fenced code block's info string does not match the configured mode.
Examples of incorrect code for this rule:
<!-- eslint markdown/fenced-code-meta: "error" -->
```js
console.log("Hello, world!");
```This rule accepts a single string option:
"always"(default): Require metadata when a language is specified."never": Disallow metadata in the info string.
Examples of incorrect code when configured as "fenced-code-meta": ["error", "always"]:
<!-- eslint markdown/fenced-code-meta: ["error", "always"] -->
```js
console.log("Hello, world!");
```Examples of correct code when configured as "fenced-code-meta": ["error", "always"]:
<!-- eslint markdown/fenced-code-meta: ["error", "always"] -->
```js title="example.js"
console.log("Hello, world!");
```Examples of incorrect code when configured as "fenced-code-meta": ["error", "never"]:
<!-- eslint markdown/fenced-code-meta: ["error", "never"] -->
```js title="example.js"
console.log("Hello, world!");
```Examples of correct code when configured as "fenced-code-meta": ["error", "never"]:
<!-- eslint markdown/fenced-code-meta: ["error", "never"] -->
```js
console.log("Hello, world!");
```If you aren't concerned with metadata in info strings, you can safely disable this rule.