You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I wrote a rule that - if it was working as expected - warns me if it finds a lone level 3 subheading in my Markdown doc. Here is the rule:
extends: occurrence
message: 'A lone h3 is detected. Lone subheadings indicate that the content is insufficient or has a weak structure.'
level: warning
scope: raw
min: 2
token: '^### '
I also have the same rule but for level 2 subheads. I tested it with the following Markdown:
# Title
An overview para.
## A subheading 2
An intro para to this section.
Another para.
### A subheading 3
Another one.
And a final one.
Buggy behaviour: Vale shows me a warning for line 1 of the code, and not for lines 5 or 11, which is where the subheadings are.
Further test: I changed the token to: 'you', and edited the Markdown so it contained the word 'you' twice. This time, the occurrence check worked -- it did not throw a warning, which is expected behaviour given that it's looking for at least two occurrences of the token. So, I believe the problem is to do with the hash key.
Why is this happening?
Is occurrence broken?
Or is my rule not correctly formed?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I wrote a rule that - if it was working as expected - warns me if it finds a lone level 3 subheading in my Markdown doc. Here is the rule:
I also have the same rule but for level 2 subheads. I tested it with the following Markdown:
Buggy behaviour: Vale shows me a warning for line 1 of the code, and not for lines 5 or 11, which is where the subheadings are.
Further test: I changed the token to: 'you', and edited the Markdown so it contained the word 'you' twice. This time, the occurrence check worked -- it did not throw a warning, which is expected behaviour given that it's looking for at least two occurrences of the token. So, I believe the problem is to do with the hash key.
Why is this happening?
Is occurrence broken?
Or is my rule not correctly formed?
Thanks,
S.
Beta Was this translation helpful? Give feedback.
All reactions