forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDuplicateAttributes.qhelp
More file actions
39 lines (31 loc) · 912 Bytes
/
DuplicateAttributes.qhelp
File metadata and controls
39 lines (31 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
According to the HTML5 standard, an HTML element must not have two or more attributes with
the same name. If the attribute values are the same, this is most likely harmless, but it
may indicate a copy-paste mistake.
</p>
</overview>
<recommendation>
<p>
Inspect the element in question and delete all but one of the redundant attributes.
</p>
</recommendation>
<example>
<p>
The following HTML snippet contains an anchor element with a redundant <code>href</code>
attribute:
</p>
<sample src="examples/DuplicateAttributes.html"/>
<p>
The redundancy can be resolved by deleting one of the attributes:
</p>
<sample src="examples/DuplicateAttributesGood.html"/>
</example>
<references>
<li>HTML5 Standard: <a href="https://www.w3.org/TR/html5/syntax.html#attributes-0">8.1.2.3 Attributes</a>.</li>
</references>
</qhelp>