squizlabs/HTML_CodeSniffer — pull request #24 by lwright-sq (2012-08-19 23:03:43+00:00)
Title: For a document fragment link, check name attributes as well as IDs for a match

This fixes an issue with a test in Success Criterion 2.4.1, which tests for the presence of a suitable named anchor when finding a link pointing to a document fragment (eg. "#htmlcs").

Originally it would only test for element IDs, which is one way of creating a named anchor in HTML 4.01 (and the only way in HTML5). However in HTML 4 a named anchor can be created using an "A" element using a "name" attribute, and this was not being tested.

This patch adds a check for this type of named anchor, and also changes the message slightly to refer to named anchors rather than "IDs".