Log in Help page Discussion History Go to the site toolbox

Difference between revisions of "Help:HTML in wikitext"

From BluWiki

 
(36 intermediate revisions by 32 users not shown)
Line 1: Line 1:
[http://oedi.freehostia.com/text/directory/pet-supply/ pet supply] [http://coarmago.t35.com/content/view/hans-zimmer/ hans zimmer cd il gladiatore] [http://selemku.t35.com/text/directory/epson-photo.htm epson photo viewer p-2000] [http://boreldar.t35.com/text/directory/cappotti-donna.htm cappotti donna] [http://getm0ney.freewebpage.org/lib/ragazzo-lugano/ ragazzo lugano] [http://selemku.t35.com/text/directory/nudismo-naturismo.htm nudismo naturismo] [http://www.freewebtown.com/boogiejames/topic/senza-famiglia.htm senza famiglia] [http://selemku.t35.com/text/directory/warsaw-escort.htm warsaw escort] [http://gawelzba.t35.com/library/html/geltona.htm geltona] [http://beshennayabelka.freehostia.com/content/view/packard-bell.htm packard bell mp3 1gb] [http://licohwar.homeblock.com/library/html/technics-/ technics - diffusore - surround] [http://benevolently.freehostia.com/content/view/the-one/ the one that the i want grease] [http://flheddin.125mb.com/content/view/ecommerce-valle.htm ecommerce valle d aosta] [http://benevolently.freehostia.com/content/view/borse-gucci/ borse gucci] [http://mauballe.125mb.com/web/agriturismo-centro/ agriturismo centro benessere] [http://oedi.freehostia.com/text/directory/tenax-spa/ tenax spa] [http://greensticky.freehostia.com/library/html/cirico/ cirico] [http://oedi.freehostia.com/text/directory/lacie-hard/ lacie hard disk] [http://gawelzba.t35.com/library/html/lexmark-e.htm lexmark e232 toner] [http://oedi.freehostia.com/text/directory/risultati-live/ risultati live] [http://getraylo.freeweb7.com/img/styles/quattro-mura.htm quattro mura it] [http://kopapguw.homeblock.com/topic/traduzione-di/ traduzione di i m with you di avril] [http://flheddin.125mb.com/content/view/lontano-dal.htm lontano dal paradiso] [http://beshennayabelka.freehostia.com/content/view/satcom.htm satcom] [http://scaleslea.freewebpage.org/text/directory/maleika/ maleika] [http://saline-joy.freehostia.com/web/le-avventure.htm le avventure di tom sawyer di mark twain] [http://mcwardlo.t35.com/library/html/iar-siltal/ iar siltal congelatori] [http://scaleslea.freewebpage.org/text/directory/powermust-/ powermust 2000 usb] [http://beshennayabelka.freehostia.com/content/view/elezion-candidati.htm elezion candidati] [http://kopapguw.homeblock.com/topic/pagine-personali/ pagine personali porno] [http://boreldar.t35.com/text/directory/netgaphono-it.htm netgaphono it] [http://coarmago.t35.com/content/view/roof/ roof] [http://www.freewebtown.com/prncessprncipe/library/html/this-live.htm this live] [http://lorcaxon.homeblock.com/data/alicia-keys/ alicia keys. the diaries of alicia keys] [http://licohwar.homeblock.com/library/html/risatissime/ risatissime] [http://failtoexpress.freehostia.com/html/massimo-ranieri.htm massimo ranieri perdere l amore] [http://licohwar.homeblock.com/library/html/in-quel/ in quel giardino proibito] [http://huruple.125mb.com/text/directory/www-fontana/ www fontana delle rose it] [http://selemku.t35.com/text/directory/as-polti.htm as800 polti] [http://www.freewebtown.com/starbriteyellow/resources/articles/foto-bikini.htm foto bikini] [http://www.freewebtown.com/starbriteyellow/resources/articles/ragazza-sulla.htm ragazza sulla scopa] [http://licohwar.homeblock.com/library/html/haring-keith/ haring keith] [http://flheddin.125mb.com/content/view/riyadh-american.htm riyadh american] [http://selemku.t35.com/text/directory/www-tim.htm www tim it com] [http://gawelzba.t35.com/library/html/lattice-elastici.htm lattice elastici] [http://coarmago.t35.com/content/view/sigla-iniziale/ sigla iniziale il grande fratello] [http://failtoexpress.freehostia.com/html/psicologia-psicoterapia.htm psicologia psicoterapia] [http://getm0ney.freewebpage.org/lib/print-server/ print server us robotics] [http://www.freewebtown.com/boogiejames/topic/i-giorni.htm i giorni della paura] [http://saline-joy.freehostia.com/web/nec-vt.htm nec vt570] [http://flheddin.125mb.com/content/view/francesca-alotta.htm francesca alotta nuda] [http://getraylo.freeweb7.com/img/styles/usb-panel.htm usb panel] [http://saline-joy.freehostia.com/web/semola-di.htm semola di grano] [http://saline-joy.freehostia.com/web/dolce-jeans.htm dolce jeans] [http://benevolently.freehostia.com/content/view/con-radio/ con radio mp3 samsung lettori] [http://zoelverd.freeweb7.com/description/lib/netbus-pro/ netbus pro 2 0] [http://beshennayabelka.freehostia.com/content/view/ricevitore-analogico.htm ricevitore analogico satellitare] [http://flheddin.125mb.com/content/view/la-straordinaria.htm la straordinaria storia della vita sulla] [http://lorcaxon.homeblock.com/data/forno-microonde/ forno microonde 23 litri ventilato] [http://gawelzba.t35.com/library/html/durch-die.htm durch die nacht] [http://huruple.125mb.com/text/directory/download-gioco/ download gioco carta] [http://wainfan.t35.com/view/new/www-vivalda.htm www vivalda it] [http://getm0ney.freewebpage.org/lib/volvo-s/ volvo s40 2001] [http://mcwardlo.t35.com/library/html/hard-disk/ hard disk portatile lettore memory card] [http://getraylo.freeweb7.com/img/styles/nino-d.htm nino d angelo mp3] [http://coarmago.t35.com/content/view/love-anna/ love anna] [http://selemku.t35.com/text/directory/piaff.htm piaff] [http://scaleslea.freewebpage.org/text/directory/nua-no/ nua no ministerio da agricultura] [http://grahrens.125mb.com/view/new/freedom-fighters/ freedom fighters] [http://getraylo.freeweb7.com/img/styles/vacanze-a.htm vacanze a gennaio] [http://grahrens.125mb.com/view/new/psg/ psg] [http://kopapguw.homeblock.com/topic/dj-blass/ dj blass y rey pirin] [http://lorcaxon.homeblock.com/data/porno-boys/ porno boys] [http://www.freewebtown.com/prncessprncipe/library/html/jessyca.htm jessyca] [http://www.freewebtown.com/boogiejames/topic/tu-sei.htm tu sei] [http://scaleslea.freewebpage.org/text/directory/valutazione-camper/ valutazione camper usato] [http://coarmago.t35.com/content/view/raccoglitori-oxford/ raccoglitori oxford] [http://zoelverd.freeweb7.com/description/lib/john-sena/ john sena] [http://benevolently.freehostia.com/content/view/n/ n 57] [http://grahrens.125mb.com/view/new/lettori-mp/ lettori mp3 ogg vorbis] [http://saline-joy.freehostia.com/web/corsi-di.htm corsi di disegno] [http://boreldar.t35.com/text/directory/waves-of.htm waves of luv 2black] [http://mauballe.125mb.com/web/aviosuperficie/ aviosuperficie] [http://getm0ney.freewebpage.org/lib/indawgyi/ indawgyi] [http://coarmago.t35.com/content/view/l-espresso/ l espresso con dvd] [http://mcwardlo.t35.com/library/html/corsi-formazione/ corsi formazione personale] [http://zoelverd.freeweb7.com/description/lib/asics-gialle/ asics gialle] [http://grahrens.125mb.com/view/new/canti-rumeni/ canti rumeni] [http://saline-joy.freehostia.com/web/monika-sport.htm monika sport modelle] [http://licohwar.homeblock.com/library/html/ford-c/ ford c max treviso] [http://beshennayabelka.freehostia.com/content/view/editori-verona.htm editori verona] [http://www.freewebtown.com/prncessprncipe/library/html/magnaccio-menager.htm magnaccio menager] [http://coarmago.t35.com/content/view/un-evaso/ un evaso ha bussato alla mia porta] [http://mcwardlo.t35.com/library/html/canzoni-fasciste/ canzoni fasciste] [http://wainfan.t35.com/view/new/www-fsj.htm www fsj co yu] [http://boreldar.t35.com/text/directory/decapitazione-fabbrizio.htm decapitazione fabbrizio quattrocchi] [http://saline-joy.freehostia.com/web/hztc.htm hztc 9] [http://saline-joy.freehostia.com/web/intel-pentium.htm intel pentium m 750] [http://flheddin.125mb.com/content/view/cerca-cantieri.htm cerca cantieri nautici] [http://lorcaxon.homeblock.com/data/ricarica-ink/ ricarica ink cartuccia compatibile] [http://benevolently.freehostia.com/content/view/barbara-bobulova/ barbara bobulova] [http://licohwar.homeblock.com/library/html/loghi-suoneria/ loghi suoneria polifoniche] [http://mauballe.125mb.com/web/cineland/ cineland] [http://oedi.freehostia.com/text/directory/manihi/ manihi] [http://getraylo.freeweb7.com/img/styles/berger-hynde.htm berger hynde] [http://selemku.t35.com/text/directory/portabiancheria-foppapedretti.htm portabiancheria foppapedretti] [http://getraylo.freeweb7.com/img/styles/www-cic.htm www cic gc ca] [http://getm0ney.freewebpage.org/lib/ms/ ms03 26] [http://coarmago.t35.com/content/view/motorola-moto/ motorola moto razr v3] [http://beshennayabelka.freehostia.com/content/view/balaton.htm balaton] [http://benevolently.freehostia.com/content/view/pc-office/ pc office] [http://greensticky.freehostia.com/library/html/methodman-redman/ methodman redman] [http://flheddin.125mb.com/content/view/the-blueprint.htm the blueprint 2 1] [http://boreldar.t35.com/text/directory/run-run.htm run run] [http://oedi.freehostia.com/text/directory/pepero-porto/ pepero porto cervo] [http://huruple.125mb.com/text/directory/wrestling-/ wrestling  arcade] [http://boreldar.t35.com/text/directory/pronto-soccorso.htm pronto soccorso veterinario] [http://mcwardlo.t35.com/library/html/polo-nord/ polo nord magnetico] [http://oedi.freehostia.com/text/directory/batterie-sonyericcson/ batterie sony-ericcson] [http://saline-joy.freehostia.com/web/testo-.htm testo 66 diabulus in musica] [http://boreldar.t35.com/text/directory/welcome-to.htm welcome to my life] [http://gawelzba.t35.com/library/html/huacho.htm huacho] [http://gawelzba.t35.com/library/html/consolle-game.htm consolle game cube] [http://huruple.125mb.com/text/directory/la-roche/ la roche cosmetici] [http://boreldar.t35.com/text/directory/hotel-a.htm hotel a sapri] [http://www.freewebtown.com/boogiejames/topic/forte-dei.htm forte dei marmi albergo] [http://mauballe.125mb.com/web/laura-angel/ laura angel sex] [http://scaleslea.freewebpage.org/text/directory/aba-shanti/ aba shanti] [http://lorcaxon.homeblock.com/data/remington-eliphalet/ remington, eliphalet] [http://mauballe.125mb.com/web/kane-elisha/ kane, elisha kent] [http://wainfan.t35.com/view/new/brocken-di.htm brocken di elisa] [http://getraylo.freeweb7.com/img/styles/profumi-emporio.htm profumi emporio armani white] [http://huruple.125mb.com/text/directory/dissipatori-schede/ dissipatori schede video ati] [http://licohwar.homeblock.com/library/html/broken-testo/ broken testo] [http://getraylo.freeweb7.com/img/styles/jackson-pollock.htm jackson pollock] [http://lorcaxon.homeblock.com/data/chivasso/ chivasso] [http://www.freewebtown.com/starbriteyellow/resources/articles/download-musica.htm download musica mp3] [http://scaleslea.freewebpage.org/text/directory/allettanti-promesse/ allettanti promesse] [http://saline-joy.freehostia.com/web/black-eyead.htm black eyead peas] [http://saline-joy.freehostia.com/web/traduzione-testo.htm traduzione testo dry your eyes] [http://wainfan.t35.com/view/new/let-loose.htm let loose] [http://lorcaxon.homeblock.com/data/dimage-a/ dimage a 2 konica minolta] [http://boreldar.t35.com/text/directory/teac-mp.htm teac mp-200 mp3 player] [http://scaleslea.freewebpage.org/text/directory/sony-fsm/ sony fs285m] [http://saline-joy.freehostia.com/web/orgoglio-di.htm orgoglio di razza] [http://gawelzba.t35.com/library/html/wrestling-.htm wrestling  arcade] [http://www.freewebtown.com/starbriteyellow/resources/articles/monitor-samsung.htm monitor samsung syncmaster 710 mp] [http://saline-joy.freehostia.com/web/lavoro-pesaro.htm lavoro pesaro] [http://zoelverd.freeweb7.com/description/lib/sony-cybershot/ sony cybershot h1] [http://benevolently.freehostia.com/content/view/proiettore-wifi/ proiettore wifi] [http://zoelverd.freeweb7.com/description/lib/salemme/ salemme] [http://benevolently.freehostia.com/content/view/masterizzatore-usb/ masterizzatore usb slim] [http://benevolently.freehostia.com/content/view/the-buggles/ the buggles] [http://beshennayabelka.freehostia.com/content/view/quai.htm quai] [http://mcwardlo.t35.com/library/html/cantautore/ cantautore] [http://boreldar.t35.com/text/directory/rok-and.htm rok and roll] [http://getm0ney.freewebpage.org/lib/manutenzione-giardini/ manutenzione giardini] [http://failtoexpress.freehostia.com/html/sexi-fattoria.htm sexi fattoria] [http://saline-joy.freehostia.com/web/sotto-la.htm sotto la maschera] [http://grahrens.125mb.com/view/new/underfish-una/ underfish una voce che] [http://gawelzba.t35.com/library/html/recapito.htm recapito] [http://oedi.freehostia.com/text/directory/www-sexe/ www sexe com] [http://www.freewebtown.com/starbriteyellow/resources/articles/stuggle.htm stuggle] [http://huruple.125mb.com/text/directory/sankt-ulrich/ sankt ulrich] [http://greensticky.freehostia.com/library/html/audi-a/ audi a3 lombardia] [http://kopapguw.homeblock.com/topic/morbegno/ morbegno] [http://selemku.t35.com/text/directory/robert-kennedy.htm robert kennedy] [http://getraylo.freeweb7.com/img/styles/owo.htm owo] [http://huruple.125mb.com/text/directory/troymovie-warner/ troymovie warner bros com] [http://mauballe.125mb.com/web/pane-parabol/ pane parabol] [http://huruple.125mb.com/text/directory/clarion-dbrmc/ clarion db458rmc] [http://beshennayabelka.freehostia.com/content/view/ati-radeon.htm ati radeon sapphire x550] [http://wainfan.t35.com/view/new/uglypeople-com.htm uglypeople com] [http://www.freewebtown.com/starbriteyellow/resources/articles/sky-calcio.htm sky calcio key] [http://kopapguw.homeblock.com/topic/tv-plasma/ tv plasma da 42] [http://huruple.125mb.com/text/directory/decapitazione-secondo/ decapitazione secondo ostaggio usa] [http://lorcaxon.homeblock.com/data/rimadesio/ rimadesio] [http://kopapguw.homeblock.com/topic/lcd-offerte/ lcd offerte 17] [http://huruple.125mb.com/text/directory/le-rovine/ le rovine maya] [http://licohwar.homeblock.com/library/html/tuner-fm/ tuner fm usb] [http://beshennayabelka.freehostia.com/content/view/rua-do.htm rua do gato preto] [http://greensticky.freehostia.com/library/html/pozzo-congelatori/ pozzo congelatori] [http://mauballe.125mb.com/web/dragonear/ dragonear] [http://zoelverd.freeweb7.com/description/lib/laura-betti/ laura betti] [http://getm0ney.freewebpage.org/lib/copertine-cd/ copertine cd madonna] [http://benevolently.freehostia.com/content/view/navigatori-auto/ navigatori auto pioneer] [http://selemku.t35.com/text/directory/canna-fumaria.htm canna fumaria] [http://zoelverd.freeweb7.com/description/lib/estadio-w/ estadio w] [http://greensticky.freehostia.com/library/html/traduzione-o/ traduzione o c] [http://gawelzba.t35.com/library/html/soso-party.htm soso party] [http://wainfan.t35.com/view/new/xxxmanga-video.htm xxxmanga video] [http://saline-joy.freehostia.com/web/sony-dcr.htm sony dcr pc1000] [http://www.freewebtown.com/prncessprncipe/library/html/transessuali-a.htm transessuali a catania] [http://getm0ney.freewebpage.org/lib/adattatore-floppy/ adattatore floppy disk] [http://oedi.freehostia.com/text/directory/evanescente/ evanescente] [http://failtoexpress.freehostia.com/html/ventilatore-a.htm ventilatore a pale] [http://getm0ney.freewebpage.org/lib/www-myanmar/ www myanmar embassy] [http://licohwar.homeblock.com/library/html/vipe/ vipe] [http://wainfan.t35.com/view/new/monfalcone.htm monfalcone] [http://getm0ney.freewebpage.org/lib/presario-hpcompaq/ presario hp-compaq portatili] {{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