This is aninformation page. It is not anencyclopedic article, nor one ofWikipedia's policies or guidelines; rather, its purpose is to explain certain aspects of Wikipedia's norms, customs, technicalities, or practices. It may reflect differing levels ofconsensus andvetting. |
TheW3C Markup Validation Service lets editors check web pages for conformance toHTML andXHTML standards. It is helpful for catching minor problems such as duplicate section names or citation IDs. Although most major browsers will tolerate many of the errors, and will display a document successfully even if it contains errors, they may misbehave on documents that contain the errors: for example, they may go to the wrong section or citation if you click the mouse on a wikilink. Checking that a page contains valid HTML can thus fix these minor glitches while also increasing portability to unusual browsers.
To check the HTML for a Wikipedia articleXYZ, visit the service's home page and enter the text "https://en.wikipedia.org/wiki/XYZ".
These errors require developer fixes and should be ignored by editors. When checking for endemic errors, ensure a blank page is used, such asSpecial:BlankPage.
Any page with an edit link:
Bad value edit for attribute rel on element link: Keyword edit is not registered. This issue does not show forSpecial:BlankPage.Any page with a file (image):
Attribute srcset not allowed on element img at this point.srcset allows the MediaWiki software to render alternate images based on the device capabilities. The W3C HTML validator has not yet been updated to support this and throws an error.Any page with a nonstandard language code:
Bad valuexxx for attribute lang on element a: The language subtagxxx is not a valid ISO language part of a language tag.While current browsers are quite forgiving of HTML errors, invalid HTML can cause issues with accessibility, search engines and portability. Various browsers may handle errors differently, thus the display may differ.
For most editors, creating valid HTML is not an issue. TheMediaWiki software converts wikimarkup into valid HTML (with occasional bugs). The English Wikipedia has usedHTML Tidy, a now-outdated HTML4 library, to help ensure that common typos and mistakes are converted into proper HTML4. However, Tidy could not fix all problems, there is no way to disable it for testing and validation will not show issues fixed by Tidy. Furthermore, Tidy isslated for removal at Wikipedia, so previously overlooked errors need to be fixed.
Portability issues occur when pages are exported to other wikis that do not use HTML Tidy and HTML errors are exposed.
Editors who use referencing methods such asFootnote3 should always validate pages. Use of these templates make it very easy for an editor to create duplicate HTML ids, causing invalid HTML and in-page linking issues – this is probably the most common validation issue on Wikipedia. There is little or no error checking for manual templates.
Editors who develop templates should always test various uses and ensure they render valid HTML.
TheW3C is the main international standards organization for the internet— they provide theW3C Markup Validation Service. Simply copy the full URL of the page to be validated and paste in into the validator. There is also afavelet that you can add to your browser bookmarks that will validate the current page.
The WDG HTML Validator has a batch mode that allows a list of URLS to be validated.
This section gives examples of diagnostics generated by the markup validation service, and suggests possible fixes. Diagnostics are by line and column of the generated HTML for the page. It may be helpful to obtain the HTML in order to understand the diagnostic. For example, if you using theFirefox browser, you can type control-U to see the HTML.
...</a></b> <spanPosition where error was detected.">CITEREFBarker2008">Barker, Janice (2008-0This error occurs if an article contains multiple invocations of the{{citation}} template with the same author and year; the above error was prompted by an article that cited two different documents, both written by Barker in 2008. Disambiguate the citations by putting letters after the years (e.g.,|year=2008a,|year=2008b), or by using theref= parameter of{{citation}}.
HTML ids are only needed when usingShortened footnotes orParenthetical referencing. A{{citation}} template orCitation Style 1 template will generate an HTML id by default.
...ence plainlinks nourlexpansion"Position where error was detected.">ref_1"><a href="#endnote_1">1</a></sup><...This similar diagnostic occurs if an article contains multiple invocations of{{ref}} with the same ID, for example, two instances of "{{ref|1|1}}". To fix the problem, use different IDs. Templates using theref_ id prefix include{{ref}},{{ref label}},{{cref}} and{{cref2}}.
...,107" title="Hurricane Ida (2009)" />This diagnostic can result from use of theEasyTimeline extension, which does not supportaccessibility and does not generatealternative text for visually impaired readers. Such a problem can be fixed by redoing the timeline as text, as an image, or as animage map.
</dl>Definition lists are created with the wikimarkup; to define a definition list and: to define the item in the list. This diagnostic results when the: is missing.
: markup. This creates a definition list with no child element.T6521; is misused to bold a line. Use the wikimarkup''' to bold characters.The W3C also has a CSS validator, but this is less of an issue when editing Wikipedia pages, as CSS is an option and CSS validation errors typically are due to problems with skins, not problems in individual pages.