Help:HTML in wikitext: Difference between revisions

Content deleted Content added
TRANSWIKI: Copied from Meta:Help:HTML in wikitext.
Line 3:
==Permitted HTML==
The following [[w:HTML element|HTML element]]s are currently permitted:
{| border="0" cellpadding="5"
| valign="top"|
Line 65:
 
<pre>
/* private */ function removeHTMLtags( $text )
{
{
wfProfileIn( "OutputPage::removeHTMLtags" );
$htmlpairs = array( # Tags that must be closed
"b", "i", "u", "font", "big", "small", "sub", "sup", "h1",
"h2", "h3", "h4", "h5", "h6", "cite", "code", "em", "s",
"strike", "strong", "tt", "var", "div", "center",
"blockquote", "ol", "ul", "dl", "table", "caption", "pre",
"ruby", "rt" , "rb" , "rp"
);
);
$htmlsingle = array(
"br", "p", "hr", "li", "dt", "dd"
);
);
$htmlnest = array( # Tags that can be nested--??
"table", "tr", "td", "th", "div", "blockquote", "ol", "ul",
"dl", "font", "big", "small", "sub", "sup"
);
);
$tabletags = array( # Can only appear inside table
"td", "th", "tr"
);
);
 
$htmlsingle = array_merge( $tabletags, $htmlsingle );
$htmlelements = array_merge( $htmlsingle, $htmlpairs );
 
$htmlattrs = array( # Allowed attributes--no scripting, etc.
"title", "align", "lang", "dir", "width", "height",
"bgcolor", "clear", /* BR */ "noshade", /* HR */
"cite", /* BLOCKQUOTE, Q */ "size", "face", "color",
/* FONT */ "type", "start", "value", "compact",
/* For various lists, mostly deprecated but safe */
"summary", "width", "border", "frame", "rules",
"cellspacing", "cellpadding", "valign", "char",
"charoff", "colgroup", "col", "span", "abbr", "axis",
"headers", "scope", "rowspan", "colspan", /* Tables */
"id", "class", "name", "style" /* For CSS */
);
);
</pre>