-
-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vale is picking up errors for stuff in code blocks in GitHub markdown #387
Comments
Assuming that this is the file in question, you're not using a standard flavor of Markdown -- it looks like you're making significant use of Liquid-like template tags along with mixing nested Markdown inside raw HTML. This means that, as you've seen, there's no guarantee that Vale will be able to correctly parse and lint your content (GitHub itself, as you can see in the file preview I linked above, cannot render it correctly). It's possible to work around these issues by using a combination of Another option would be to run Vale on your site's generated HTML, which should just work as you'd expect. |
Thanks so much for answering my question. It all makes sense now. I will try running Vale on site generated HTML. Considering this scenario, will I be able to use Vale Action to run only on lines modified in a PRs? I am assuming that would work as expected if the modified lines do not have the Liquid like templates 😞 |
I added a regular expression to BlockIgnores and TokenIgnores to avoid code blocks! Seems like it is not picking up things from code blocks and errors. This is how my
|
I used this regex in TokenIgnores to for code blocks so Vale can ignore them. Vale is still picking up terms from code blocks. Not sure if I am missing something. Here is my .vale.ini
|
Yes, I'd like to make something clear: the behavior you're experiencing is not a bug with Vale. I cannot emphasize enough that I think you'd be better off running Vale on the HTML generated by whatever you use to build your site. The problem, as I mentioned in my previous comment, is that your content is different enough from CommonMark that Markdown assumptions (like ignoring code blocks) no longer apply. More specifically, your regex doesn't match what you appear to think it matches. If you test against the entire file (or a significant portion) in regex101, you'll quickly see that this is the case. Additionally, the goal with |
Here is my
.vale.ini
There are the types of errors it is picking up:
content/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions.md:152:53:Vale.Terms:Use 'hostname' instead of 'HOSTNAME'.
`
content/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions.md:236:21:Vale.Terms:Use 'npm' instead of 'NPM'.
Not sure what I am missing.
The text was updated successfully, but these errors were encountered: