vale: improve ignores for hugo markup

Shortcode tags spanning over multiple lines were not being ignored

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-09-27 14:28:32 +02:00
parent ae74c20dde
commit 183b0dcdd0
1 changed files with 10 additions and 2 deletions

View File

@ -3,7 +3,15 @@ MinAlertLevel = suggestion
Vocab = Docker
Packages = Hugo
[*.md]
BasedOnStyles = Vale, Docker
# Exclude `{{< ... >}}`, `{{% ... %}}`, [Who]({{< ... >}})
TokenIgnores = ({{[%<] .* [%>]}}.*?{{[%<] ?/.* [%>]}}), \
(\[.+\]\({{< .+ >}}\)), \
[^\S\r\n]({{[%<] \w+ .+ [%>]}})\s, \
[^\S\r\n]({{[%<](?:/\*) .* (?:\*/)[%>]}})\s, \
(?sm)({{[%<] .*?\s[%>]}})
# Exclude `{{< myshortcode `This is some <b>HTML</b>, ... >}}`
BlockIgnores = (?sm)^({{[%<] \w+ [^{]*?\s[%>]}})\n$, \
(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}})