From 183b0dcdd09487e8451377abb52ff5b2cd532ad8 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:28:32 +0200 Subject: [PATCH] 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> --- .vale.ini | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.vale.ini b/.vale.ini index c8101f4fb2..710e13b2ff 100644 --- a/.vale.ini +++ b/.vale.ini @@ -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 HTML, ... >}}` +BlockIgnores = (?sm)^({{[%<] \w+ [^{]*?\s[%>]}})\n$, \ +(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}})