Log in Help page Discussion History Go to the site toolbox

Difference between revisions of "Help:HTML in wikitext"

From BluWiki

m (Reverted edits by 192.72.124.10 (Talk); changed back to last version by Sam Odio)
Line 1: Line 1:
[http://lazythoughts.110mb.com/lib/key-west/ key west ristorante] [http://yeeden.110mb.com/data/raiz-scegli/ raiz scegli me testo] [http://sister-sunshine.110mb.com/html/concerto-d/ concerto d amore] [http://unremig.110mb.com/samsung-/ samsung 17 lcd] [http://dialed.110mb.com/small/la-dolce/ la dolce vita del soldato joe] [http://trouble166.110mb.com/gli-angeli.htm gli angeli vasco rossi] [http://gekijuls.110mb.com/gps-bluetooth/ gps bluetooth nokia 7610] [http://lazythoughts.110mb.com/lib/mario-aventura/ mario aventura] [http://gekijuls.110mb.com/domenica-mattina/ domenica mattina] [http://yeeden.110mb.com/data/cd-donatella/ cd donatella rettore] [http://slavkamolot.110mb.com/library/alfa-romeo/ alfa romeo 145 quadrifoglio] [http://mouse-zae.110mb.com/toshiba-m.htm toshiba m 730] [http://dialed.110mb.com/small/emozione-non/ emozione non ha voce] [http://some-omeelse.110mb.com/data/sesso-con.htm sesso con cavalli] [http://dialed.110mb.com/small/djevojka-sa/ djevojka sa sela severina] [http://book-wench.110mb.com/text/viejos-desnudos/ viejos desnudos] [http://olikka.110mb.com/library/ferri-da.htm ferri da stiro con caldaia imetec no] [http://gekijuls.110mb.com/perline-legno/ perline legno] [http://stitchesnglue.110mb.com/turion.htm turion 3400] [http://mouse-zae.110mb.com/slide-along.htm slide along slide shifty] [http://ultra-creator.110mb.com/articles/auto.htm auto 1 10] [http://some-omeelse.110mb.com/data/motorizzazione-di.htm motorizzazione di trieste] [http://gekijuls.110mb.com/www-escortforum/ www escortforum com] [http://lazythoughts.110mb.com/lib/coupe-turbo/ coupe turbo 20v] [http://dialed.110mb.com/small/www-shevchenko/ www shevchenko com] [http://lazythoughts.110mb.com/lib/audio-shell/ audio shell] [http://sister-sunshine.110mb.com/html/caffe-al/ caffe al bar] [http://yeeden.110mb.com/data/sony-w/ sony w15] [http://dialed.110mb.com/small/bridge-cisco/ bridge cisco] [http://unremig.110mb.com/ricoh-d/ ricoh 1230d] [http://nationavce.110mb.com/view/samsung-.htm samsung 21 pollici] [http://unremig.110mb.com/catania-firenze/ catania firenze] [http://nationavce.110mb.com/view/tv-slim.htm tv slim] [http://mouse-zae.110mb.com/lettore-dvd.htm lettore dvd mustek] [http://nationavce.110mb.com/view/burattini.htm burattini] [http://olikka.110mb.com/library/assal.htm assal] [http://lazythoughts.110mb.com/lib/driver-guide/ driver guide for miro] [http://gekijuls.110mb.com/kiss-destroyer/ kiss destroyer] [http://gekijuls.110mb.com/palmari-qtek/ palmari qtek9090] [http://unremig.110mb.com/dimage-g/ dimage g600] [http://forever-your.110mb.com/data/la-fiera.htm la fiera dll est] [http://slavkamolot.110mb.com/library/coppia-scambio/ coppia scambio] [http://ultra-creator.110mb.com/articles/foto-taglio.htm foto taglio capelli uomo] [http://blue-olusha.110mb.com/library/theme-movie/ theme movie the net] [http://mouse-zae.110mb.com/lipsia.htm lipsia] [http://blue-olusha.110mb.com/library/holzmichel-noch/ holzmichel noch] [http://ultra-creator.110mb.com/articles/los-angel.htm los angel] [http://ultra-creator.110mb.com/articles/pasodobles.htm pasodobles] [http://lazythoughts.110mb.com/lib/sigma-af/ sigma af 70200 2 8] [http://sister-sunshine.110mb.com/html/la-terra/ la terra dei cachi] [http://slavkamolot.110mb.com/library/lulla/ lulla] [http://blue-olusha.110mb.com/library/luomo-in/ luomo in uniforme] [http://olikka.110mb.com/library/sava-stoianov.htm sava stoianov] [http://olikka.110mb.com/library/orologio-omega.htm orologio omega] [http://gekijuls.110mb.com/shoop-shoop/ shoop shoop song] [http://book-wench.110mb.com/text/ink-film/ ink film philips] [http://forever-your.110mb.com/data/indomabile.htm indomabile] [http://dialed.110mb.com/small/eugene/ eugene] [http://stitchesnglue.110mb.com/temi-esami.htm temi esami di stato 2004] [http://book-wench.110mb.com/text/seline-dion/ seline dion] [http://forever-your.110mb.com/data/mudd.htm mudd] [http://olikka.110mb.com/library/io-sono.htm io sono curiosa] [http://dialed.110mb.com/small/sottomesse/ sottomesse] [http://book-wench.110mb.com/text/il-/ il  cacciatore  di  taglie] [http://stitchesnglue.110mb.com/a-napoli.htm a napoli] [http://lazythoughts.110mb.com/lib/benassi-brother/ benassi brother] [http://unremig.110mb.com/hp-compaq/ hp compaq dc5000] [http://trouble166.110mb.com/cicco.htm cicco] [http://ultra-creator.110mb.com/articles/chloe-savigny.htm chloe savigny] [http://lazythoughts.110mb.com/lib/fiat-milano/ fiat milano] [http://nationavce.110mb.com/view/panasonic-dmc.htm panasonic dmc lx1egs] [http://sister-sunshine.110mb.com/html/www-bromamania/ www bromamania net] [http://slavkamolot.110mb.com/library/villach/ villach] [http://funk-mastah-ion.110mb.com/data/sony-vaio.htm sony vaio b3vp] [http://lazythoughts.110mb.com/lib/foto-raoul/ foto raoul bova] [http://gekijuls.110mb.com/engine/ engine] [http://some-omeelse.110mb.com/data/smak-doun.htm smak doun] [http://ultra-creator.110mb.com/articles/w-w.htm w w w] [http://lazythoughts.110mb.com/lib/work-out/ work out plan] [http://sister-sunshine.110mb.com/html/luna-rossi/ luna rossi] [http://blue-olusha.110mb.com/library/medici-di/ medici di famiglia] [http://gekijuls.110mb.com/satellix-da/ satellix da ru] [http://trouble166.110mb.com/www-las.htm www las pollas mas peludas] [http://mouse-zae.110mb.com/voli-rimini.htm voli rimini] [http://gekijuls.110mb.com/televisori-daewoo/ televisori daewoo 29] [http://trouble166.110mb.com/sweet-home.htm sweet home halabama] [http://sister-sunshine.110mb.com/html/lodetti/ lodetti] [http://trouble166.110mb.com/toshiba-t.htm toshiba t40] [http://lazythoughts.110mb.com/lib/un-amore/ un amore perfetto film dvd] [http://ultra-creator.110mb.com/articles/quotazione-oro.htm quotazione oro] [http://stitchesnglue.110mb.com/filati-a.htm filati a stock] [http://lazythoughts.110mb.com/lib/to-nem/ to nem ai totale] [http://dialed.110mb.com/small/c-e/ c e posta chicco] [http://stitchesnglue.110mb.com/knights-.htm knights  i cavalieri del futuro] [http://unremig.110mb.com/senza-giacca/ senza giacca e cravatta nino d angelo] [http://trouble166.110mb.com/avventuriera.htm avventuriera] [http://yeeden.110mb.com/data/indice-dei/ indice dei numeri precedenti] [http://blue-olusha.110mb.com/library/siemens-sl/ siemens sl440 cordless] [http://blue-olusha.110mb.com/library/racconto-bondage/ racconto bondage] [http://trene-von-anty.110mb.com/description/loredana-berte.htm loredana berte classifica] [http://lazythoughts.110mb.com/lib/prestito-personali/ prestito personali palermo] [http://trene-von-anty.110mb.com/description/www-rm.htm www rm unicatt it] [http://sister-sunshine.110mb.com/html/wwf-c/ wwf c] [http://olikka.110mb.com/library/crociera-a.htm crociera a egitto] [http://forever-your.110mb.com/data/classifica-serie.htm classifica serie b] [http://dialed.110mb.com/small/scuola-di/ scuola di recitazione roma] [http://trouble166.110mb.com/o-zone.htm o zone mi] [http://olikka.110mb.com/library/pppp.htm pppp] [http://trouble166.110mb.com/hyundai-coup.htm hyundai coup 16v 16 fx max] [http://book-wench.110mb.com/text/delchi-carrier/ delchi carrier condizionatori] [http://stitchesnglue.110mb.com/ora-x.htm ora x attacco al giappone] [http://book-wench.110mb.com/text/holz/ holz] [http://mouse-zae.110mb.com/tn-casalinghi.htm tn casalinghi snc] [http://nationavce.110mb.com/view/pitching-put.htm pitching put golf] [http://trouble166.110mb.com/senti-come.htm senti come puzzi] [http://sneezingpops.110mb.com/ipod-nano/ ipod nano 2 gb] [http://gekijuls.110mb.com/l-evoluzione/ l evoluzione dell uomo] [http://lazythoughts.110mb.com/lib/dream-system/ dream system] [http://ultra-creator.110mb.com/articles/monster-allergy.htm monster allergy] [http://trene-von-anty.110mb.com/description/telecamere-digitali.htm telecamere digitali hitachi] [http://slavkamolot.110mb.com/library/gta-viceciti/ gta viceciti] [http://dialed.110mb.com/small/wp-associated/ wp associated srl] [http://slavkamolot.110mb.com/library/helena-swedin/ helena swedin] [http://unremig.110mb.com/www-annuncitelefonici/ www annuncitelefonici com] [http://some-omeelse.110mb.com/data/mustek-mp.htm mustek mp3 40 gb] [http://sneezingpops.110mb.com/split-mono/ split mono] [http://unremig.110mb.com/divani-per/ divani per pub] [http://nationavce.110mb.com/view/krawczyk-bartosiewicz.htm krawczyk bartosiewicz trudno tak mp3] [http://olikka.110mb.com/library/fucili-sub.htm fucili sub] [http://stitchesnglue.110mb.com/tvputas.htm tvputas] [http://trene-von-anty.110mb.com/description/km-.htm km 0 focus] [http://stitchesnglue.110mb.com/decapitazione-bulgaro.htm decapitazione bulgaro video] [http://some-omeelse.110mb.com/data/dati.htm dati] [http://funk-mastah-ion.110mb.com/data/profumi-eternity.htm profumi eternity men] [http://yeeden.110mb.com/data/pollein/ pollein] [http://some-omeelse.110mb.com/data/x-aiw.htm x600 aiw] [http://funk-mastah-ion.110mb.com/data/cartuccia-ink.htm cartuccia ink jet stampante] [http://some-omeelse.110mb.com/data/sblocco-rete.htm sblocco rete nece 616] [http://forever-your.110mb.com/data/trattieni-il.htm trattieni il respiro] [http://book-wench.110mb.com/text/creme-per/ creme per il corpo] [http://book-wench.110mb.com/text/edintorni/ edintorni] [http://trene-von-anty.110mb.com/description/cat-e.htm cat e dog] [http://unremig.110mb.com/base-amandoti/ base amandoti gianna nannini] [http://blue-olusha.110mb.com/library/musica-da/ musica da discoteca 2004] [http://unremig.110mb.com/truetones/ truetones] [http://yeeden.110mb.com/data/canon-eos/ canon eos 350d efs 1855 ii] [http://sneezingpops.110mb.com/hotel-maglie/ hotel maglie] [http://nationavce.110mb.com/view/canon-ef.htm canon ef 70200 2 8 l usm] [http://funk-mastah-ion.110mb.com/data/seca-cfg.htm seca2 cfg] [http://book-wench.110mb.com/text/naghmeh/ naghmeh] [http://gekijuls.110mb.com/immagini-deni/ immagini deni grossi] [http://dialed.110mb.com/small/no-la/ no la folle gloria del comando] [http://slavkamolot.110mb.com/library/delta-med/ delta med srl] [http://sneezingpops.110mb.com/fino-/ fino 70 s] [http://lazythoughts.110mb.com/lib/voip-wifi/ voip wifi] [http://book-wench.110mb.com/text/piallatrice/ piallatrice] [http://sister-sunshine.110mb.com/html/lettore-dvd/ lettore dvd schermo integrato] [http://gekijuls.110mb.com/corsi-per/ corsi per bag design] [http://sneezingpops.110mb.com/codice-sblocco/ codice sblocco nec e616v] [http://ultra-creator.110mb.com/articles/star-wars.htm star wars] [http://slavkamolot.110mb.com/library/ibox-it/ ibox it mms] [http://unremig.110mb.com/cometa-snc/ cometa snc] [http://sister-sunshine.110mb.com/html/baby-queen/ baby queen] [http://trouble166.110mb.com/rsmmcdv.htm rsmmcdv 512] [http://forever-your.110mb.com/data/masterizzatore-combo.htm masterizzatore combo] [http://trouble166.110mb.com/hp-dvea.htm hp dv1356ea pavillion] [http://sneezingpops.110mb.com/aldo-annunziata/ aldo annunziata srl] [http://sneezingpops.110mb.com/palloni-di/ palloni di calio] [http://unremig.110mb.com/enanitos/ enanitos] [http://unremig.110mb.com/microsoft-office/ microsoft office sbe] [http://gekijuls.110mb.com/qmov-en/ qmov en videos] [http://yeeden.110mb.com/data/desktop-amd/ desktop amd athlon 64 computer] [http://stitchesnglue.110mb.com/cantantes-italianos.htm cantantes italianos] [http://trene-von-anty.110mb.com/description/sreca-song.htm sreca song ki] [http://yeeden.110mb.com/data/plasma-/ plasma 50 pollici] [http://book-wench.110mb.com/text/cyzone-com/ cyzone com] [http://sister-sunshine.110mb.com/html/www-solidarieta/ www solidarieta it] [http://ultra-creator.110mb.com/articles/madre-e.htm madre e figlio] [http://trene-von-anty.110mb.com/description/nuova-mercedes.htm nuova mercedes classe c diesel auto] [http://olikka.110mb.com/library/free-porn.htm free porn site] [http://mouse-zae.110mb.com/reflex-foto.htm reflex foto nikon] [http://stitchesnglue.110mb.com/ritter-hellmut.htm ritter hellmut] [http://slavkamolot.110mb.com/library/chatellerault/ chatellerault] [http://blue-olusha.110mb.com/library/van-van/ van van de cuba] [http://slavkamolot.110mb.com/library/video-grande/ video grande fratello 1] [http://sister-sunshine.110mb.com/html/ixus-/ ixus 700 batterie canon per foto e video] [http://ultra-creator.110mb.com/articles/escape-the.htm escape the detention] [http://dialed.110mb.com/small/speedy-et/ speedy et lumidee sientelo] [http://some-omeelse.110mb.com/data/casse-z.htm casse z3] [http://book-wench.110mb.com/text/golden-tulip/ golden tulip hotel inntel amsterdam] [http://funk-mastah-ion.110mb.com/data/cani-piccola.htm cani piccola taglia] [http://sister-sunshine.110mb.com/html/asiago-vicenza/ asiago vicenza casa affitto vacanza] [http://stitchesnglue.110mb.com/www-amg.htm www amg it] [http://funk-mastah-ion.110mb.com/data/compil-hot.htm compil hot party summer 2004] [http://trouble166.110mb.com/www-studiocasa.htm www studiocasa it] [http://funk-mastah-ion.110mb.com/data/frizioni.htm frizioni] [http://sneezingpops.110mb.com/maccchine-rally/ maccchine rally] [http://sneezingpops.110mb.com/campania-office/ campania office] [http://dialed.110mb.com/small/tubi-di/ tubi di rame] [http://sister-sunshine.110mb.com/html/garmin-usb/ garmin usb] {{Incomplete}}
+
{{Incomplete}}
 
From Wikipedia  [http://en.wikipedia.org/wiki/Help:HTML_in_wikitext] GNU Free Documentation License (GFDL)
 
From Wikipedia  [http://en.wikipedia.org/wiki/Help:HTML_in_wikitext] GNU Free Documentation License (GFDL)
  
Line 7: Line 7:
 
{| border="0" cellpadding="5"
 
{| border="0" cellpadding="5"
 
| valign="top"|
 
| valign="top"|
* [[w:HTML_element#Presentational_markup|
+
* [[w:HTML_element#Presentational_markup|<b>]]
 +
* [[w:HTML_element#Presentational_markup|<big>]]
 +
* [[w:HTML_element#Block-level|<blockquote>]]
 +
* [[w:HTML_element#Others|<br>]]
 +
* [[w:HTML_element#Tables|<caption>]]
 +
* <center>
 +
* <cite>
 +
* [[w:HTML_element#Inline|<code>]]
 +
* [[w:HTML_element#Lists|<dd>]]
 +
* [[w:HTML_element#Other_containers|<div>]]
 +
* [[w:HTML_element#Lists|<dl>]]
 +
* [[w:HTML_element#Lists|<dt>]]
 +
* [[w:HTML_element#Inline|<em>]]
 +
* [[w:HTML_element#Presentational_markup|<font>]]
 +
* [[w:HTML_element#Headings|<h1>]]
 +
| valign="top"|
 +
* [[w:HTML_element#Headings|<h2>]]
 +
* [[w:HTML_element#Headings|<h3>]]
 +
* [[w:HTML_element#Headings|<h4>]]
 +
* [[w:HTML_element#Headings|<h5>]]
 +
* [[w:HTML_element#Headings|<h6>]]
 +
* [[w:HTML_element#Block-level|<hr>]]
 +
* [[w:HTML_element#Presentational_markup|<i>]]
 +
* [[w:HTML_element#Lists|<li>]]
 +
* [[w:HTML_element#Lists|<ol>]]
 +
* [[w:HTML_element#Block-level|<p>]]
 +
* [[w:HTML_element#Block-level|<pre>]]
 +
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ <rb>]
 +
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ <rp>]
 +
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ <rt>]
 +
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ <ruby>]
 +
| valign="top"|
 +
* [[w:HTML_element#Presentational_markup|<s>]]
 +
* [[w:HTML_element#Presentational_markup|<small>]]
 +
* [[w:HTML_element#Presentational_markup|<strike>]]
 +
* [[w:HTML_element#Inline|<strong>]]
 +
* [[w:HTML_element#Inline|<sub>]]
 +
* [[w:HTML_element#Inline|<sup>]]
 +
* [[w:HTML_element#Tables|<table>]]
 +
* [[w:HTML_element#Tables|<td>]]
 +
* [[w:HTML_element#Tables|<th>]]
 +
* [[w:HTML_element#Tables|<tr>]]
 +
* [[w:HTML_element#Presentational_markup|<tt>]]
 +
* [[w:HTML_element#Presentational_markup|<u>]]
 +
* [[w:HTML_element#Lists|<ul>]]
 +
* [[w:HTML_element#Inline|<var>]]
 +
* [[w:HTML_element#Others|<!-- ... -->]]
 +
|}
 +
 
 +
The following excerpt from [http://cvs.sourceforge.net/viewcvs.py/wikipedia/phpwiki/newcodebase/OutputPage.php OutputPage.php] additionally shows which attributes are allowed.
 +
 
 +
:'''Update:''' In 1.4rc1, the removeHTMLtags function is located in Parser.php.
 +
 
 +
:'''Update:''' In 1.5, the removeHTMLtags function is now located in Sanitizer.php.
 +
 
 +
For many HTML elements, more convenient wikitext code is available, see [[Help:Editing]]. On the other hand, HTML tags allow an id that can be referenced in one's [[Help:User style|user style]] css, and allows the tag to be used as link target.
 +
 
 +
<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>
 +
 
 +
E.g., element "a" is not allowed, and the wikitext
 +
 
 +
<a href="<nowiki>http://meta.wikimedia.org/wiki/Main_Page</nowiki>">Main Page</a>
 +
 
 +
produces the HTML code
 +
 
 +
&amp;lt;a href="<nowiki>http://meta.wikimedia.org/wiki/Main_Page</nowiki>"&amp;gt;Main Page&amp;lt;/a&amp;gt;
 +
 
 +
which renders as the wikitext, not working as a link.
 +
 
 +
==Span==
 +
 
 +
<code><nowiki><span></nowiki></code>, a generic inline text container, is now allowed on default MediaWiki installations (as of version 1.5). Span can be ID'd, classed, or styled:
 +
 
 +
<nowiki>This is <span style="color:red">red</span> text.</nowiki>
 +
 +
<nowiki>This is <span id="randomfooid">identified</span> text.</nowiki>
 +
 +
<nowiki>This is <span class="importantmessage">classed</span> text.</nowiki>
 +
produces:
 +
 
 +
<blockquote>
 +
 
 +
This is <span style="color:red">red</span> text.
 +
 
 +
This is <span id="randomfooid">identified</span> text.
 +
 
 +
This is <span class="importantmessage">classed</span> text.
 +
 
 +
</blockquote>
 +
 
 +
IDs and classes are used in conjunction with stylesheets to give a piece of text a descriptive class (or unique identifier) and to refer to that in a stylesheet.
 +
 
 +
Note that in most cases, one can use a more descriptive tag, for instance, <strong><nowiki><strong></nowiki></strong> (which can be classed, identified, and styled, as well) to indicate an important piece of text, or <em><nowiki><em></nowiki></em> (subject to the same things as strong) to indicate an emphasized piece of text. For instance, the above might be better reformulated as
 +
 
 +
<nowiki>This is <em style="color:red;font-style:normal">red</em> text.</nowiki>
 +
 
 +
<blockquote>This is <em style="color:red;font-style:normal">red</em> text.</blockquote>
 +
 
 +
This not only draws the user's attention to the text, but can also alert those who are using nonvisual browsers or have sight impairments, etc. to the fact that that is <em>emphasized text</em>.
 +
 
 +
Using {{timc|H:title}}, <nowiki>"a height of {{h:title|6.1 km|20000 ft}} above sea level"</nowiki> gives "a height of {{h:title|6.1 km|20000 ft}} above sea level" (note the hover box over "20000 ft").
 +
 
 +
==Font==
 +
 
 +
''Note: This element is [[w:Deprecation|deprecate]]d (should not be used) in favor of [[#Span|<nowiki><span></nowiki>]].''
 +
 
 +
For some attributes, like color, one can also use
 +
 
 +
<pre>
 +
a <font style="color: red">red</font> word
 +
</pre>
 +
 
 +
or
 +
 
 +
<pre>
 +
a <font color=red>red</font> word.
 +
</pre>
 +
 
 +
giving
 +
 
 +
a <font style="color: red">red</font> word
 +
 
 +
a <font color=red>red</font> word
 +
 
 +
==Div==
 +
 
 +
E.g. to assign the class "red" to a text one can put
 +
 
 +
&lt;div class="red">example text&lt;/div>
 +
 
 +
which gives <div class="red">example text</div> which is in red if the css line
 +
 
 +
.red {color:red}
 +
 
 +
is applicable.
 +
 
 +
This is suitable if the color is specifically intended to be red; if it is just for emphasis a more general term for the class would be more appropriate, because css allows the user to choose another method of emphasis (another color, bold, enlarged, etc.).
 +
 
 +
Note that many readers will not have their own css with such lines as ".red {color:red}", so one cannot refer to "the red text above", etc.
 +
 
 +
==External links==
 +
 
 +
* [http://www.w3.org/TR/html401/index/elements.html elements] | [http://www.w3.org/TR/html401/index/attributes.html attributes]
 +
 
 +
{{H:f|langs=|enname=HTML in wikitext}}
 +
 
 +
[[Category:Help]]

Revision as of 18:45, 25 August 2007

Accessories-text-editor.png Incomplete page: please contribute. - BluWiki is unique in that original page authors normally decide who can edit their page. By putting this banner up, the author(s) of this page believe it is incomplete, and is asking for the assistance of others. Please help them by adding useful information to it. You might find more information about what is needed in discussion of this page.

From Wikipedia [1] GNU Free Documentation License (GFDL)

Permitted HTML

The following HTML elements are currently permitted:

The following excerpt from OutputPage.php additionally shows which attributes are allowed.

Update: In 1.4rc1, the removeHTMLtags function is located in Parser.php.
Update: In 1.5, the removeHTMLtags function is now located in Sanitizer.php.

For many HTML elements, more convenient wikitext code is available, see Help:Editing. On the other hand, HTML tags allow an id that can be referenced in one's user style css, and allows the tag to be used as link target.

        /* 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 */
                );

E.g., element "a" is not allowed, and the wikitext

<a href="http://meta.wikimedia.org/wiki/Main_Page">Main Page</a>

produces the HTML code

&lt;a href="http://meta.wikimedia.org/wiki/Main_Page"&gt;Main Page&lt;/a&gt;

which renders as the wikitext, not working as a link.

Span

<span>, a generic inline text container, is now allowed on default MediaWiki installations (as of version 1.5). Span can be ID'd, classed, or styled:

This is <span style="color:red">red</span> text.

This is <span id="randomfooid">identified</span> text.

This is <span class="importantmessage">classed</span> text.

produces:

This is red text.

This is identified text.

This is classed text.

IDs and classes are used in conjunction with stylesheets to give a piece of text a descriptive class (or unique identifier) and to refer to that in a stylesheet.

Note that in most cases, one can use a more descriptive tag, for instance, <strong> (which can be classed, identified, and styled, as well) to indicate an important piece of text, or <em> (subject to the same things as strong) to indicate an emphasized piece of text. For instance, the above might be better reformulated as

This is <em style="color:red;font-style:normal">red</em> text.
This is red text.

This not only draws the user's attention to the text, but can also alert those who are using nonvisual browsers or have sight impairments, etc. to the fact that that is emphasized text.

Using Template:Timc, "a height of {{h:title|6.1 km|20000 ft}} above sea level" gives "a height of 20000 ft above sea level" (note the hover box over "20000 ft").

Font

Note: This element is deprecated (should not be used) in favor of <span>.

For some attributes, like color, one can also use

a <font style="color: red">red</font> word

or

a <font color=red>red</font> word.

giving

a red word

a red word

Div

E.g. to assign the class "red" to a text one can put

<div class="red">example text</div>
which gives
example text
which is in red if the css line
.red {color:red}

is applicable.

This is suitable if the color is specifically intended to be red; if it is just for emphasis a more general term for the class would be more appropriate, because css allows the user to choose another method of emphasis (another color, bold, enlarged, etc.).

Note that many readers will not have their own css with such lines as ".red {color:red}", so one cannot refer to "the red text above", etc.

External links

Template:H:f

Site Toolbox:

Personal tools
GNU Free Documentation License 1.2

Disclaimers - About BluWiki