-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Describe the bug
False positive for Unterminated listing block
from ValidCodeBlocks because a literal block in same file has one ----
inside it.
The total count of ----
in the file is odd, so the ValidCodeBlocks rule is triggered. But contents inside listing blocks and literal blocks aren't rendered as AsciiDoc, so asciidoctor
renders just fine.
Examples:
Kubernetes kubectl
"pretty" output is styled similarly to AsciiDoc, in the kubectl describe
output. To nest it, we've used a literal block ....
:
[source,subs="verbatim,attributes"]
....
Name: aws-auth
Namespace: kube-system
Labels: <none>
Annotations: <none>
Data
====
mapRoles:
----
- groups:
- system:bootstrappers
- system:nodes
rolearn: {arn-aws}iam::111122223333:role/my-node-role
username: system:node:{{EC2PrivateDNSName}}
BinaryData
====
Events: <none>
....
latest/ug/manage-access/k8s-access/auth-configmap.adoc
37:1 error Unterminated listing block AsciiDoc.ValidCodeBlocks
found in file.
To Reproduce
Steps to reproduce the behavior:
- Add this word or expression:
----
Create the listing block
----
....
Create a literal block that happens to have a listing block fence in another syntax.
----
....
- Vale reports an illegitimate alert: error.
Expected behavior
Literals such as inside a listing block or literal block, should be able to contain asciidoc syntax and not trigger the rule.
Additional context
With vale regex, this is probably pretty difficult? Is there a way to exclude the contents of listing and literal blocks from being counted in other rules?