This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 238339

Summary: [validator] Incorrect warning when wrapping block level element with anchor tag in HTML5
Product: web Reporter: zoszsoz
Component: HTML EditorAssignee: Milutin Kristofic <mkristofic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description zoszsoz 2013-11-14 02:46:34 UTC
In HTML5 it is now completely valid syntax to wrap a block level element such as a "div" or "li" in an "a" (anchor) tag.

For example if I do this to make the whole "li" line clickable:

<ul>
  <a "home.html">
    <li>Home</li>
  </a>
</ul>	

In Netbeans it throws an error saying:

Element "a" not allowed as a child element of "ul" in this context.

This error is valid for HTML4 and XHTML doctypes, not HTML5 doctype. It is useful to make a whole element clickable without resorting to "cursor: pointer" and a JavaScript click event to accomplish the same thing.

Please remove this error if the HTML is in HTML5 doctype.

Thank you.
Comment 1 zoszsoz 2013-11-14 02:49:39 UTC
Supporting thread:

http://davidwalsh.name/html5-elements-links
Comment 2 zoszsoz 2013-11-14 02:53:41 UTC
Regex Rule Category: Elements structure.
Comment 3 Vladimir Riha 2013-11-26 07:26:50 UTC
Reproducible

Product Version: NetBeans IDE Dev (Build 201311260002)