Skip to content

element-permitted-occurrences

Reports an element that the parent permits at most once (<head>, <body>, <title>, <caption>) when it appears again. A <script> or <style> after </body> opens an implied <head>, and is reported.

The browser keeps the first one and merges or drops the others, so the second <title> has no effect and the content in a second <body> ends up somewhere else.

To fix, remove the repeated element, or merge its content into the first.

Reported
<!DOCTYPE html>
<html lang="en">
<head><title>x</title><title>y</title></head>
<body>
...
angular:
lint:
rules:
element-permitted-occurrences: warn # off (default), warn, error
html:
lint:
rules:
element-permitted-occurrences: warn # off (default), warn, error
svelte:
lint:
rules:
element-permitted-occurrences: warn # off (default), warn, error
vue:
lint:
rules:
element-permitted-occurrences: warn # off (default), warn, error

Enabled by the presets: html/html-validate-standard.

Suppress one line with sudsy-disable-next-line element-permitted-occurrences in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
html-validate element-permitted-occurrences partial the content model of html-validate (data/model.txt); elements that no model row names are not judged