> For the complete documentation index, see [llms.txt](https://docs.vale.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vale.sh/formats/html.md).

# 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](https://github.com/vale-cli/vale/issues/320) 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`](/keys/skippedscopes.md), the inline list by [`IgnoredScopes`](/keys/ignoredscopes.md), and the classes are added to by [`IgnoredClasses`](/keys/ignoredclasses.md).

## [Templates](#templates)

Text that has no element of its own can be excluded by pattern: a [`BlockIgnores`](/keys/blockignores.md) match is wrapped in `<pre>`, a [`TokenIgnores`](/keys/tokenignores.md) match in `<code>`. That masks the tags of a template language, so the prose around them is linted and the variables are not:

```ini
[*.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:

```ini
[formats]
txt = md
```

## [Comments](#comments)

Vale supports comment-based configuration in HTML files:

* Turn Vale off entirely:

```html
<!-- vale off -->

This text will be ignored.

<!-- vale on -->
```

* Turn off a specific rule:

```html
<!-- vale Style.Redundancy = NO -->

This is some text ACT test

<!-- vale Style.Redundancy = YES -->
```

* Turn off specific match(es) within a rule:

```html
<!-- vale Style.Redundancy["ACT test","OTHER"] = NO -->

This is some text ACT test

<!-- vale Style.Redundancy["ACT test","OTHER"] = YES -->
```

* Turn on or off specific styles:

```html
<!-- vale StyleName1 = YES -->
<!-- vale StyleName2 = NO -->
```

* Set styles (enabling them and switching off any other styles):

```html
<!-- vale style = StyleName1 -->
<!-- vale styles = StyleName1, StyleName2 -->
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.vale.sh/formats/html.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
