Help:HTML in wikitext: Difference between revisions

Content deleted Content added
Anihl (talk | contribs)
Permitted HTML: updated links to revised HTML Elements article
fix links
Line 1:
{{shortcut|H:HTML}}
==Permitted HTML==
The following [[w:HTML element|HTML element]]s are currently permitted:
{| border="0" cellpadding="5" class="plainlinks"
| valign="top"|
* [[w:HTML_elementHTML element#Presentation|<b>]]
* [[w:HTML_elementHTML element#Presentation|<big>]]
* [[w:HTML_elementHTML element#Other Block Elements|<blockquote>]]
* [[w:HTML_elementHTML element#Other Inline Elements|<br>]]
* [[w:HTML_elementHTML element#Tables|<caption>]]
* [[w:HTML_elementHTML element#Other Block Elements|<center>]]
* [[w:HTML_elementHTML element#Other Inline Elements|<cite>]]
* [[w:HTML_elementHTML element#Computer Phrase Elements|<code>]]
* [[w:HTML_elementHTML element#Lists|<dd>]]
* [[w:HTML_elementHTML element#Other Block Elements|<del>]]
* [[w:HTML_elementHTML element#Other Block Elements|<div>]]
* [[w:HTML_elementHTML element#Lists|<dl>]]
* [[w:HTML_elementHTML element#Lists|<dt>]]
* [[w:HTML_elementHTML element#General|<em>]]
* [[w:HTML_elementHTML element#Presentation|<font>]]
* [[w:HTML_elementHTML element#Basic Text|<h1>]]
| valign="top"|
* [[w:HTML_elementHTML element#Basic Text|<h2>]]
* [[w:HTML_elementHTML element#Basic Text|<h3>]]
* [[w:HTML_elementHTML element#Basic Text|<h4>]]
* [[w:HTML_elementHTML element#Basic Text|<h5>]]
* [[w:HTML_elementHTML element#Basic Text|<h6>]]
* [[w:HTML_elementHTML element#Other Block Elements|<hr>]]
* [[w:HTML_elementHTML element#Presentation|<i>]]
* [[w:HTML_elementHTML element#Other Block Elements|<ins>]]
* [[w:HTML_elementHTML element#Lists|<li>]]
* [[w:HTML_elementHTML element#Lists|<ol>]]
* [[w:HTML_elementHTML element#Basic Text|<p>]]
* [[w:HTML_elementHTML element#Other Block Elements|<pre>]]
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ <rb>]
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ <rp>]
Line 39:
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ <ruby>]
| valign="top"|
* [[w:HTML_elementHTML element#Presentation|<s>]]
* [[w:HTML_elementHTML element#Presentation|<small>]]
* [[w:HTML_elementHTML element#Span|<span>]]
* [[w:HTML_elementHTML element#Presentation|<strike>]]
* [[w:HTML_elementHTML element#General|<strong>]]
* [[w:HTML_elementHTML element#Other Inline Elements|<sub>]]
* [[w:HTML_elementHTML element#Other Inline Elements|<sup>]]
* [[w:HTML_elementHTML element#Tables|<table>]]
* [[w:HTML_elementHTML element#Tables|<td>]]
* [[w:HTML_elementHTML element#Tables|<th>]]
* [[w:HTML_elementHTML element#Tables|<tr>]]
* [[w:HTML_elementHTML element#Presentation|<tt>]]
* [[w:HTML_elementHTML element#Presentation|<u>]]
* [[w:HTML_elementHTML element#Lists|<ul>]]
* [[w:HTML_elementHTML element#Computer Phrase Elements|<var>]]
* [[w:HTML_elementHTML element#HTML Comment|<!-- ... -->]]
|}
 
 
For many HTML elements, more convenient wikitext code is available, see [[Help:Editing]]. On the other hand, HTML tags allow an <tt>id</tt> that can be referenced in one's [[Help:User style|user style]] cssCSS, and allows the tag to be used as link target.
 
 
Line 106:
== Tags ==
 
{{mlw|HTML_elementHTML element|Span element|<code>'''&lt;span>'''</code>}} is a generic inline text container.
 
<code>'''&lt;font>'''</code> is a similar tag which is [[w:Deprecationdeprecation|deprecate]]d (should not be used) in favor of <nowiki><span></nowiki>.''
 
For example
Line 119:
</source>
 
See also {{tim|font size demo}} and [[metam:Help:Text color]].
 
It's pointless to combine the legacy tag <tt>&lt;font&gt;</tt>
Line 140:
* <nowiki></div></nowiki> should be preceded by a newline
*<nowiki></div></nowiki> followed by text on the same line, two newlines and text before <nowiki><div></nowiki> on the same line should be avoided (because the two newlines only produce a space)
 
Example:
 
{{xpdplain|
--|--|
|o
 
p<|div>q<|/div>r
 
s<|div>|t|
|u|
|v|
|x<|/div>y
 
s<|div>|t|
|u|
|v|
|x<|/div>y
 
z|
|--|--|
}}
 
===HTML comment===
Line 167 ⟶ 145:
*{{xpd|t}}
*"<code><nowiki>{{subst:xpd|t}}</nowiki>"</code> gives "&lt;!--t-->start-pqr-end", producing HTML code without the comment.
The "Remove comments" option of [[mw:Extension:ExpandTemplates|ExpandTemplates]] selects whether comments are removed, not just in the final result but throughout the expansion process. This affects the result of parser functions: a comment in the expression of #expr or in the condition of #ifexpr gives an error message unless "Remove comments" is on, and comments affect #if and #ifeq.
 
Example:
Line 275 ⟶ 253:
* HTML 4.01 specification: [http://www.w3.org/TR/html401/index/elements.html elements] | [http://www.w3.org/TR/html401/index/attributes.html attributes]
* For customizing the handling of HTML in MediaWiki, see the HTML and Tidy sections in [[mw:Manual:Configuration settings]]
* Some extensions allow adding arbitrary HTML to a page, for example [[mw:Extension:AddHTML]],[[mw:Extension:SecureHTML]] and [[mw:Extension:Secure HTML]]; see [http[mw://www.mediawiki.org/wiki/Manual:%24wgRawHtml $wgRawHtml|$wgRawHtml]] for a more complete list
* Within the MediaWiki codebase, these HTML checks happen in [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Sanitizer.php includes/Sanitizer.php]