mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Update MD040/fenced-code-language to add language_only parameter to reject extra data in info string.
This commit is contained in:
parent
718de432f3
commit
72439f42c6
13 changed files with 176 additions and 1 deletions
|
@ -1623,6 +1623,7 @@ Aliases: `fenced-code-language`
|
|||
Parameters:
|
||||
|
||||
* `allowed_languages`: List of languages (`string[]`, default `[]`)
|
||||
* `language_only`: Require language only (`boolean`, default `false`)
|
||||
|
||||
This rule is triggered when fenced code blocks are used, but a language isn't
|
||||
specified:
|
||||
|
@ -1655,6 +1656,13 @@ You can configure the `allowed_languages` parameter to specify a list of
|
|||
languages code blocks could use. Languages are case sensitive. The default value
|
||||
is `[]` which means any language specifier is valid.
|
||||
|
||||
You can prevent extra data from being present in the info string of fenced code
|
||||
blocks. To do so, set the `language_only` parameter to `true`.
|
||||
|
||||
<!-- markdownlint-disable-next-line no-space-in-code -->
|
||||
Info strings with leading/trailing whitespace (ex: `js `) or other content (ex:
|
||||
`ruby startline=3`) will trigger this rule.
|
||||
|
||||
Rationale: Specifying a language improves content rendering by using the
|
||||
correct syntax highlighting for code. More information:
|
||||
<https://cirosantilli.com/markdown-style-guide#option-code-fenced>.
|
||||
|
|
|
@ -7,6 +7,7 @@ Aliases: `fenced-code-language`
|
|||
Parameters:
|
||||
|
||||
* `allowed_languages`: List of languages (`string[]`, default `[]`)
|
||||
* `language_only`: Require language only (`boolean`, default `false`)
|
||||
|
||||
This rule is triggered when fenced code blocks are used, but a language isn't
|
||||
specified:
|
||||
|
@ -39,6 +40,13 @@ You can configure the `allowed_languages` parameter to specify a list of
|
|||
languages code blocks could use. Languages are case sensitive. The default value
|
||||
is `[]` which means any language specifier is valid.
|
||||
|
||||
You can prevent extra data from being present in the info string of fenced code
|
||||
blocks. To do so, set the `language_only` parameter to `true`.
|
||||
|
||||
<!-- markdownlint-disable-next-line no-space-in-code -->
|
||||
Info strings with leading/trailing whitespace (ex: `js `) or other content (ex:
|
||||
`ruby startline=3`) will trigger this rule.
|
||||
|
||||
Rationale: Specifying a language improves content rendering by using the
|
||||
correct syntax highlighting for code. More information:
|
||||
<https://cirosantilli.com/markdown-style-guide#option-code-fenced>.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue