Log in Help page Discussion History Go to the site toolbox

Difference between revisions of "Help:HTML in wikitext"

From BluWiki

 
(31 intermediate revisions by 28 users not shown)
Line 1: Line 1:
[http://ofdays.isuisse.com/library/nokia-/ nokia 1100 yellow] [http://ruoj-ruoj.isuisse.com/description/volo-napoli/ volo napoli sharm el sheikh] [http://epbristo.angelfire.com/wireless-lan/ wireless lan pocket pc] [http://flameshes.isuisse.com/topic/tatuaggi-sole/ tatuaggi sole e lune] [http://hexa1598.ibelgique.com/leo-steel/ leo steel] [http://the-ile.iespana.es/canala/ canala] [http://zelankom.iespana.es/united-sport/ united sport equipement] [http://bet-deratos.iespana.es/topic/sharik-leon/ sharik leon] [http://mubathsh.angelfire.com/text/luna-branduardi.htm luna branduardi] [http://blaleyne.angelfire.com/new/cerco-lavoro.htm cerco lavoro musicale] [http://annie-fialochka.ibelgique.com/lib/testa.htm testa] [http://sportsgal25.iespana.es/blog/ugurlama.htm ugurlama] [http://stdamin.angelfire.com/resources/biliardo-.htm biliardo 8 nero] [http://mongo42.ibelgique.com/guernesey/ guernesey] [http://billy-brown.isuisse.com/blog/griglia-a.htm griglia a gas] [http://magenta4eva.iespana.es/fotocamere-digitali.htm fotocamere digitali canon digital ixus] [http://ofdays.isuisse.com/library/dana-plato/ dana plato] [http://brkim.angelfire.com/resources/telefonia-satellitare.htm telefonia satellitare] [http://billy-brown.isuisse.com/blog/forza-italia.htm forza italia mp3] [http://annie-fialochka.ibelgique.com/lib/hard-disk.htm hard disk esterno di rete] [http://ruoj-ruoj.isuisse.com/description/telefonino-nokia/ telefonino nokia 6310i] [http://borg77.iespana.es/styles/lettori-mp/ lettori mp3 lettore foto] [http://marebeck.angelfire.com/new/camper-usati/ camper usati roma] [http://brkim.angelfire.com/resources/autostrada-europa.htm autostrada europa] [http://bodendrucker.ibelgique.com/resources/hard-drive/ hard drive extreme] [http://borg77.iespana.es/styles/the-grand/ the grand prix collection formula uno 1972] [http://you-edicks.iespana.es/web/pac-.htm pac 55 eco] [http://brkim.angelfire.com/resources/marcia-d.htm marcia d ordinanza della guardia di finanz] [http://flameshes.isuisse.com/topic/bi-and/ bi and gay group] [http://muamive.isuisse.com/library/enel-d/ enel d70] [http://levirgule.iespana.es/juliana-do/ juliana do bbb4] [http://bet-deratos.iespana.es/topic/bong/ bong] [http://cakresen.angelfire.com/articles/kamasutra-tetris.htm kamasutra tetris] [http://miki-hana.isuisse.com/description/toda-la/ toda la cumbia santafesina] [http://anryg.iespana.es/lib/ferrari-f.htm ferrari f430] [http://eupnea.ibelgique.com/la-strada/ la strada del ritorno] [http://mongo42.ibelgique.com/asus-ngt/ asus n6800gt] [http://pooponastick.ibelgique.com/description/harvest-moon/ harvest moon anche su playstation 2] [http://zigz-kom.isuisse.com/il-tesoro/ il tesoro di montecristo] [http://bodendrucker.ibelgique.com/resources/scheda-video/ scheda video dual head pci] [http://re-nrevival.isuisse.com/view/notizie-sull.htm notizie sull inquinamento] [http://flameshes.isuisse.com/topic/hispachat/ hispachat] [http://therealocelot.ibelgique.com/articles/transazioni-on/ transazioni on line] [http://vanisky-love.iespana.es/resources/fax-software/ fax software free] [http://todomy.ibelgique.com/directory/il-monaco/ il monaco] [http://you-edicks.iespana.es/web/sanremo-hotel.htm sanremo hotel] [http://glchinsy.angelfire.com/topic/configurazione-samsung/ configurazione samsung sgh s500] [http://todomy.ibelgique.com/directory/sala-conferenza/ sala conferenza] [http://stdamin.angelfire.com/resources/software-per.htm software per mixare] [http://arb-digits.iespana.es/web/maigret-e.htm maigret e i gangsters] [http://muamive.isuisse.com/library/www-szalay/ www szalay at] [http://ohsoemo22a.ibelgique.com/library/altec-lansing.htm altec lansing 5 1] [http://arb-digits.iespana.es/web/v-batteria.htm v535 batteria motorola batterie per] [http://samuiel.isuisse.com/html/sansui-italia/ sansui italia] [http://den-namore.isuisse.com/www-emon/ www emon it] [http://den-namore.isuisse.com/scarpe-donna/ scarpe donna con tacco alto gucci] [http://samuiel.isuisse.com/html/negozi-di/ negozi di video giochi] [http://sarahxion.ibelgique.com/blog/zdenka-micka.htm zdenka micka] [http://scsheppe.angelfire.com/articles/disonesti.htm disonesti] [http://song-love.iespana.es/content/ricambio-moto/ ricambio moto morini] [http://grizs.iespana.es/articles/x-radeon.htm x700 radeon agp] [http://pooponastick.ibelgique.com/description/volkswagen-lupo/ volkswagen lupo 14 trendline] [http://pooponastick.ibelgique.com/description/testi-canzoni/ testi canzoni sampdoria] [http://mongo42.ibelgique.com/adidas-stan/ adidas stan smith confort] [http://akyla-pera.isuisse.com/text/celentano-serafino.htm celentano serafino] [http://sportsgal25.iespana.es/blog/la-donna.htm la donna misteriosa] [http://marebeck.angelfire.com/new/rapidshare/ rapidshare] [http://muamive.isuisse.com/library/biglietto-augurio/ biglietto augurio pasqua] [http://samuiel.isuisse.com/html/le-cinque/ le cinque equazioni che hanno cambiato] [http://brvarcoe.angelfire.com/styles/hotel-villa.htm hotel villa olimpia] [http://grizs.iespana.es/articles/ulivo.htm ulivo] [http://add-clab.isuisse.com/styles/nuova-fiat.htm nuova fiat punto 1 2 dynamic benzina] [http://vanisky-love.iespana.es/resources/brighton-hotel/ brighton hotel] [http://marebeck.angelfire.com/new/matura-boob/ matura boob] [http://miki-hana.isuisse.com/description/lanni/ lanni] [http://den-namore.isuisse.com/mpeg-lilli/ mpeg lilli carati] [http://da-kosta.iespana.es/directory/corsica-case.htm corsica case vacanza] [http://girlwithacurl.ibelgique.com/small/software-busta.htm software busta paga] [http://billy-brown.isuisse.com/blog/eugenio-zolli.htm eugenio zolli] [http://zigz-kom.isuisse.com/singole-x/ singole x singoli lombardia] [http://brkim.angelfire.com/resources/modelli-auto.htm modelli auto renault] [http://ana-princes.iespana.es/new/questo-mai/ questo mai di maggio video] [http://scsheppe.angelfire.com/articles/sinfonia-n.htm sinfonia n40] [http://add-clab.isuisse.com/styles/retro-illuminata.htm retro illuminata] [http://quarantined-x.iespana.es/view/televisori-/ televisori 15 pollici] [http://marebeck.angelfire.com/new/televisore-colore/ televisore colore sinudyne] [http://masteriii.isuisse.com/fata-dei.htm fata dei confetti] [http://borg77.iespana.es/styles/elgar/ elgar] [http://bodendrucker.ibelgique.com/resources/holmail/ holmail] [http://epbristo.angelfire.com/crowford/ crowford] [http://quarantined-x.iespana.es/view/ms-access/ ms access] [http://vanisky-love.iespana.es/resources/dieta-e/ dieta e fumo] [http://zigz-kom.isuisse.com/que-linda/ que linda es cuba] [http://masteriii.isuisse.com/solo-chat.htm solo chat italiane] [http://salpukka.isuisse.com/lib/due-filmati/ due filmati per zelda] [http://salpukka.isuisse.com/lib/maneggi-provincia/ maneggi provincia vercelli] [http://eupnea.ibelgique.com/moduli-di/ moduli di excel xp] [http://hibiscus-blue.ibelgique.com/view/avvio-difficile.htm avvio difficile per xbox in corea] [http://epbristo.angelfire.com/los-invasores/ los invasores de nuevo leon] [http://ravenmax.iespana.es/albergo-a.htm albergo a roccaraso] [http://miki-hana.isuisse.com/description/gioiello-on/ gioiello on line] [http://pahopewe.angelfire.com/resources/minner.htm minner] [http://miki-hana.isuisse.com/description/dolce-e/ dolce e gabbana occhiali da sole] [http://billy-brown.isuisse.com/blog/vaso-rossi.htm vaso rossi] [http://epbristo.angelfire.com/nude-in/ nude in discoteca] [http://scsheppe.angelfire.com/articles/socket-.htm socket 478 i] [http://arb-digits.iespana.es/web/athlon-.htm athlon 3400 64 plus] [http://da-kosta.iespana.es/directory/uomo-in.htm uomo in machina] [http://salpukka.isuisse.com/lib/codici-gta/ codici gta sant andreas] [http://marebeck.angelfire.com/new/trasporti-funebri/ trasporti funebri] [http://hibiscus-blue.ibelgique.com/view/washington-dc.htm washington dc cose fare] [http://scsheppe.angelfire.com/articles/fax-canon.htm fax canon laser] [http://pahopewe.angelfire.com/resources/nia-com.htm nia com] [http://the-ile.iespana.es/cuando-ella/ cuando ella me amaba] [http://cakresen.angelfire.com/articles/tuttosesso-gay.htm tuttosesso gay] [http://brkim.angelfire.com/resources/lady-mermelade.htm lady mermelade] [http://abr-abrante.iespana.es/content/xxxmanga-video/ xxxmanga video] [http://mentalquicksand.ibelgique.com/library/ebay-italia.htm ebay italia] [http://farshad-uk.isuisse.com/styles/adventures-the.htm adventures the james bombs] [http://ana-princes.iespana.es/new/mini-one/ mini one roma] [http://glchinsy.angelfire.com/topic/grand-hotel/ grand hotel de la ville] [http://bodendrucker.ibelgique.com/resources/pittura-del/ pittura del 900] [http://bodendrucker.ibelgique.com/resources/video-di/ video di usher] [http://add-clab.isuisse.com/styles/foto-viewer.htm foto viewer] [http://quarantined-x.iespana.es/view/irgun-zvai/ irgun zvai leumi] [http://masteriii.isuisse.com/dj-book.htm dj book] [http://marebeck.angelfire.com/new/wolfenstein-enemy/ wolfenstein enemy territory] [http://sharkymel.isuisse.com/web/playstation-/ playstation 2 slim] [http://muamive.isuisse.com/library/cavalier-king/ cavalier king charles spaniel] [http://re-nrevival.isuisse.com/view/anticipi-posticipi.htm anticipi posticipi serie 2003 2004] [http://glmillig.angelfire.com/library/christina-plat.htm christina plat] [http://iaa.ibelgique.com/blog/sexy-patatina.htm sexy patatina] [http://eupnea.ibelgique.com/eleonora-di/ eleonora di miele foto] [http://marebeck.angelfire.com/new/torneo-di/ torneo di tennis  tennis game] [http://bodendrucker.ibelgique.com/resources/la-isla/ la isla bonita madonna] [http://billy-brown.isuisse.com/blog/leslie-sobri.htm leslie sobri mp3] [http://zigz-kom.isuisse.com/audi-nuoro/ audi nuoro] [http://sarahxion.ibelgique.com/blog/monitor-lcd.htm monitor lcd prezzo] [http://ruoj-ruoj.isuisse.com/description/modena-city/ modena city ramblers] [http://anryg.iespana.es/lib/sisi-srl.htm sisi srl] [http://song-love.iespana.es/content/hp-n/ hp 2550n] [http://abr-abrante.iespana.es/content/barry-white/ barry white tema de amor] [http://mongo42.ibelgique.com/asrock-nforce/ asrock nforce3] [http://todomy.ibelgique.com/directory/spremuta/ spremuta] [http://epbristo.angelfire.com/porta-tv/ porta tv etnico] [http://dafredri.angelfire.com/articles/libri-gabriele/ libri gabriele mino] [http://cakresen.angelfire.com/articles/foods.htm foods] [http://farshad-uk.isuisse.com/styles/scrittori-italiani.htm scrittori italiani] [http://jkc42.ibelgique.com/il-signore.htm il signore del castello] [http://vanisky-love.iespana.es/resources/nokia-/ nokia 9300 communicator] [http://killbox.ibelgique.com/html/just-cavalli.htm just cavalli jeans] [http://miki-hana.isuisse.com/description/il-sindacalista/ il sindacalista] [http://glchinsy.angelfire.com/topic/mimetica-tedesca/ mimetica tedesca] [http://borg77.iespana.es/styles/modelli-excel/ modelli excel 2000] [http://dafredri.angelfire.com/articles/remix-gabry/ remix gabry ponte] [http://songsoutofkey.isuisse.com/view/in-the.htm in the sanctuary] [http://girlwithacurl.ibelgique.com/small/camarillo-brillo.htm camarillo brillo] [http://hexa1598.ibelgique.com/kakuto-chojin/ kakuto chojin] [http://therealocelot.ibelgique.com/articles/pc-mb/ pc 512mb] [http://salpukka.isuisse.com/lib/notte-ubriaca/ notte ubriaca grande fratello] [http://hexa1598.ibelgique.com/en-bola/ en bola] [http://therealocelot.ibelgique.com/articles/cordless-sl/ cordless sl440] [http://zelankom.iespana.es/canon-eos/ canon eos 20d 18 55 55] [http://re-nrevival.isuisse.com/view/hong-nhung.htm hong nhung nude] [http://add-clab.isuisse.com/styles/mrk-produzione.htm mrk produzione] [http://ofdays.isuisse.com/library/non-parli/ non parli mai] [http://songsoutofkey.isuisse.com/view/amo-il.htm amo il cazzo] [http://cutterjon.isuisse.com/content/tiempo-y.htm tiempo y silencio] [http://da-kosta.iespana.es/directory/i-siti.htm i siti di oggi] [http://miki-hana.isuisse.com/description/pronto-il/ pronto il client di the universal] [http://ms-dirtnap.ibelgique.com/description/home-theatre/ home theatre divx sony] [http://magenta4eva.iespana.es/kocaeli.htm kocaeli] [http://scsheppe.angelfire.com/articles/beautiful-soul.htm beautiful soul di jesse mc cartney] [http://therealocelot.ibelgique.com/articles/six-execise/ six execise] [http://miki-hana.isuisse.com/description/societa-sami/ societa sami (mi] [http://sharkymel.isuisse.com/web/intrusivo/ intrusivo] [http://sharkymel.isuisse.com/web/donne-indiavolate/ donne indiavolate] [http://dafredri.angelfire.com/articles/valentina-stella/ valentina stella] [http://anryg.iespana.es/lib/frigorifero-ariston.htm frigorifero ariston mta] [http://you-edicks.iespana.es/web/fifa-.htm fifa 2000 gbc] [http://ofdays.isuisse.com/library/david-hasselhoff/ david hasselhoff] [http://ruoj-ruoj.isuisse.com/description/nuova-honda/ nuova honda transalp 2005] [http://brkim.angelfire.com/resources/gli-impressionisti.htm gli impressionisti] [http://magenta4eva.iespana.es/nuove-immagini.htm nuove immagini da blitzkrieg 2] [http://cutterjon.isuisse.com/content/girls-nude.htm girls nude] [http://eupnea.ibelgique.com/kaeon/ kaeon] [http://add-clab.isuisse.com/styles/urla.htm urla] [http://bet-deratos.iespana.es/topic/domini-ue/ domini ue] [http://mongo42.ibelgique.com/rocket-/ rocket  robot on wheels] [http://akyla-pera.isuisse.com/text/elefantino-blu.htm elefantino blu] [http://akyla-pera.isuisse.com/text/ver-fotografias.htm ver fotografias de lenny kravitz] [http://scsheppe.angelfire.com/articles/samsung-condizionatori.htm samsung condizionatori fissi] [http://ofdays.isuisse.com/library/il-giardino/ il giardino dell amore] [http://blaleyne.angelfire.com/new/in-tour.htm in tour] [http://farshad-uk.isuisse.com/styles/spaccio-aziendale.htm spaccio aziendale it] [http://marebeck.angelfire.com/new/claydermann/ claydermann] [http://abr-abrante.iespana.es/content/canon-g/ canon g3] [http://bodendrucker.ibelgique.com/resources/software-paghe/ software paghe] [http://night-sacrifice.isuisse.com/resources/delisle-guillaume.htm delisle guillaume] [http://jkc42.ibelgique.com/normativa-orario.htm normativa orario di lavoro] {{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]]

Latest revision as of 20:25, 20 May 2011

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
This page was last modified on 20 May 2011, at 20:25.
Disclaimers - About BluWiki