diff --git a/docs/user-guide/list-rules.md b/docs/user-guide/list-rules.md index cf82d3454..be36fa2e4 100644 --- a/docs/user-guide/list-rules.md +++ b/docs/user-guide/list-rules.md @@ -23,6 +23,7 @@ title: List of rules - [`attr-unsafe-chars`](/docs/user-guide/rules/attr-unsafe-chars): Attribute values cannot contain unsafe chars. - [`attr-value-double-quotes`](/docs/user-guide/rules/attr-value-double-quotes): Attribute values must be in double quotes. - [`attr-value-not-empty`](/docs/user-guide/rules/attr-value-not-empty): All attributes must have values. +- [`attr-whitespace`](/docs/user-guide/rules/attr-whitespace): No leading or trailing spaces in attribute values. - [`alt-require`](/docs/user-guide/rules/alt-require): The alt attribute of an element must be present and alt attribute of area[href] and input[type=image] must have a value. - [`input-requires-label`](/docs/user-guide/rules/input-requires-label): All [ input ] tags must have a corresponding [ label ] tag. diff --git a/docs/user-guide/rules/attr-whitespace.md b/docs/user-guide/rules/attr-whitespace.md new file mode 100644 index 000000000..afe3d27a9 --- /dev/null +++ b/docs/user-guide/rules/attr-whitespace.md @@ -0,0 +1,29 @@ +--- +id: attr-whitespace +title: attr-whitespace +--- + +No leading or trailing spaces inside attribute values. + +Level: `error` + +## Config value + +1. true: enable rule +2. false: disable rule + +The following pattern are **not** considered violations: + + +```html +
+``` + +The following pattern is considered violation: + + +```html + + + +```