HTML
Learn how Vale handles HTML content.
HTML5 support is built in. The supported extensions are .html, .htm, .shtml, and .xhtml.
By default, Vale skips the script, style, pre, noscript, and iframe elements, everything inside them included, and the inline code, tt, kbd, and samp elements. An element carrying the class pre, code, or problematic is skipped too. URLs are ignored as well (see URL handling for more information).
Two attributes are prose and are linted: an image's alt text, as text.attr.alt, and the page's description -- <meta name="description"> or og:description -- as text.attr.description. Naming alt or description in SkippedScopes leaves one out.
The block list is replaced by SkippedScopes, the inline list by IgnoredScopes, and the classes are added to by IgnoredClasses.
Templates
Text that has no element of its own can be excluded by pattern: a BlockIgnores match is wrapped in <pre>, a TokenIgnores match in <code>. That masks the tags of a template language, so the prose around them is linted and the variables are not:
[*.html]
BasedOnStyles = Vale
BlockIgnores = (?s)({%\s*comment\s*%}.*?{%\s*endcomment\s*%})
TokenIgnores = ({{.*?}}), ({%.*?%}), ({#.*?#})Text inside a tag, such as the string in {% translate "..." %}, is masked with it. A plain-text template, such as an email, has no markup to wrap a match in; read it as Markdown instead, which accepts the same patterns:
[formats]
txt = mdComments
Vale supports comment-based configuration in HTML files:
Turn Vale off entirely:
Turn off a specific rule:
Turn off specific match(es) within a rule:
Turn on or off specific styles:
Set styles (enabling them and switching off any other styles):
Last updated