canonical / praecepta

Creative Commons Attribution Share Alike 4.0 International
11 stars 15 forks source link

DOCPR-381: Vale rule no. 11 no stacked headings #27

Closed AnneCYH closed 1 month ago

AnneCYH commented 1 month ago

Hi @evilnick ,

This PR is for DOCPR-381.

I did make some changes w.r.t. the definition of this rule.

Headings of the same level can follow each other (e.g. H1 > H2 > H2) as long as there is intervening text in between.

So this rule checks for stacked headings (with no content under the heading) regardless if the consecutive headings are of the same level, or different levels. This would also help detect errors if headings are unintentionally defined in the source files but not expanded on.

I've added 2 test files with minimal test cases that should trigger errors for this rule.

Thanks!