Update MD040/fenced-code-language to add allowed_languages parameter (fixes #610).

This commit is contained in:
Sam Chen 2022-10-18 03:29:29 +08:00 committed by GitHub
parent c333976a44
commit 01ba757d3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 199 additions and 9 deletions

View file

@ -1571,6 +1571,8 @@ Tags: code, language
Aliases: fenced-code-language
Parameters: allowed_languages (array of string; default [])
This rule is triggered when fenced code blocks are used, but a language isn't
specified:
@ -1598,6 +1600,9 @@ Plain text in a code block
```
````
You can configure the `allowed_languages` parameter to specify a list of
languages code blocks could use. The default value is `[]` which means any language specifier is valid.
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>.