Help talk:Formatting

$wgRawHtml
Does the wgRawHtml variable still work?? I can't get it to work, and I am trying to add a form to my main page. -- annon 02:51, 27 July 2006


 * Yes $wgRawHtml should work still. See Manual:$wgRawHtml Note that it's a security risk (and not normally necessary)  -- Harry Wood 11:53, 14 December 2006 (UTC)

Tables
It might be helpful to have a help page on how to construct a table, like the oh-so-pretty one on this page, ferinstance. If such a page exists, I cannot find it; there should be a link to it from this page if it does exist but is simply hiding from me. - UniqueCrash5  15:51, 6 December 2006


 * That's available at Help:Tables. Alternatively the big guide to tables on Meta tells you more than you need to know!
 * Yeah I agree we should link to Help:Tables (and various other advanced formatting info) from this page -- Harry Wood 11:53, 14 December 2006 (UTC)

What About An HTML Symbols Guide?
As an HTML duffer :&THORN; I like access to these symbols. How about either adding this to help:formatting, or posting the replacement technique is instead? What follows is my PD cheat sheet with the more popular symbols in mediawiki bold. I'll leave it here for a registered user to post if they are so moved. -

HTML tags for symbols: &Aacute; &amp;Aacute;, &aacute; &amp;aacute;, &Acirc; &amp;Acirc;, &acirc; &amp;acirc;, &acute; &amp;acute;, &AElig; &amp;AElig;, &aelig; &amp;aelig;, &Agrave; &amp;Agrave;, &agrave; &amp;agrave;, &alefsym; &amp;alefsym;, &Alpha; &amp;Alpha;, &alpha; &amp;alpha;, &amp; &amp;amp;, &and; &amp;and;, &ang; &amp;ang;, &Aring; &amp;Aring;, &aring; &amp;aring;, &asymp; &amp;asymp;, &Atilde; &amp;Atilde;, &atilde; &amp;atilde;, &Auml; &amp;Auml;, &auml; &amp;auml;, &bdquo; &amp;bdquo;, &Beta; &amp;Beta;, &beta; &amp;beta;, &brvbar; &amp;brvbar;, &bull; &amp;bull;, &cap; &amp;cap;, &Ccedil; &amp;Ccedil;, &ccedil; &amp;ccedil;, &cedil; &amp;cedil;, &cent; &amp;cent;, &Chi; &amp;Chi;, &chi; &amp;chi;, &circ; &amp;circ;, &clubs; &amp;clubs;, &cong; &amp;cong;, &copy; &amp;copy;, &crarr; &amp;crarr;, &cup; &amp;cup;, &curren; &amp;curren;, &dagger; &amp;dagger;, &Dagger; &amp;Dagger;, &darr; &amp;darr;, &dArr; &amp;dArr;, &deg; &amp;deg;, &Delta; &amp;Delta;, &delta; &amp;delta;, &diams; &amp;diams;, &divide; &amp;divide;, &Eacute; &amp;Eacute;, &eacute; &amp;eacute;, &Ecirc; &amp;Ecirc;, &ecirc; &amp;ecirc;, &Egrave; &amp;Egrave;, &egrave; &amp;egrave;, &empty; &amp;empty;, &emsp; &amp;emsp;, &ensp; &amp;ensp;, &Epsilon; &amp;Epsilon;, &epsilon; &amp;epsilon;, &equiv; &amp;equiv;, &Eta; &amp;Eta;, &eta; &amp;eta;, &ETH; &amp;ETH;, &eth; &amp;eth;, &Euml; &amp;Euml;, &euml; &amp;euml;, &euro; &amp;euro;, &exist; &amp;exist;, &fnof; &amp;fnof;, &forall; &amp;forall;, &frac12; &amp;frac12;, &frac14; &amp;frac14;, &frac34; &amp;frac34;, &frasl; &amp;frasl;, &Gamma; &amp;Gamma;, &gamma; &amp;gamma;, &ge; &amp;ge;, &gt; &amp;gt;, &harr; &amp;harr;, &hArr; &amp;hArr;, &hearts; &amp;hearts;, &hellip; &amp;hellip;, &Iacute; &amp;Iacute;, &iacute; &amp;iacute;, &Icirc; &amp;Icirc;, &icirc; &amp;icirc;, &iexcl; &amp;iexcl;, &Igrave; &amp;Igrave;, &igrave; &amp;igrave;, &image; &amp;image;, &infin; &amp;infin;, &int; &amp;int;, &Iota; &amp;Iota;, &iota; &amp;iota;, &iquest; &amp;iquest;, &isin; &amp;isin;, &Iuml; &amp;Iuml;, &iuml; &amp;iuml;, &Kappa; &amp;Kappa;, &kappa; &amp;kappa;, &Lambda; &amp;Lambda;, &lambda; &amp;lambda;, &lang; &amp;lang;, &laquo; &amp;laquo;, &larr; &amp;larr;, &lArr; &amp;lArr;, &lceil; &amp;lceil;, &ldquo; &amp;ldquo;, &le; &amp;le;, &lfloor; &amp;lfloor;, &lowast; &amp;lowast;, &loz; &amp;loz;, &lrm; &amp;lrm;, &lsaquo; &amp;lsaquo;, &lsquo; &amp;lsquo;, &lt; &amp;lt;, &macr; &amp;macr;, &mdash; &amp;mdash;, &micro; &amp;micro;, &middot; &amp;middot;, &minus; &amp;minus;, &Mu; &amp;Mu;, &mu; &amp;mu;, &nabla; &amp;nabla;,  &amp;nbsp;, – &amp;ndash;, &ne; &amp;ne;, &ni; &amp;ni;, &not; &amp;not;, &notin; &amp;notin;, &nsub; &amp;nsub;, &Ntilde; &amp;Ntilde;, &ntilde; &amp;ntilde;, &Nu; &amp;Nu;, &nu; &amp;nu;, &Oacute; &amp;Oacute;, &oacute; &amp;oacute;, &Ocirc; &amp;Ocirc;, &ocirc; &amp;ocirc;, &OElig; &amp;OElig;, &oelig; &amp;oelig;, &Ograve; &amp;Ograve;, &ograve; &amp;ograve;, &oline; &amp;oline;, &Omega; &amp;Omega;, &omega; &amp;omega;, &Omicron; &amp;Omicron;, &omicron; &amp;omicron;, &oplus; &amp;oplus;, &or; &amp;or;, &ordf; &amp;ordf;, &ordm; &amp;ordm;, &Oslash; &amp;Oslash;, &oslash; &amp;oslash;, &Otilde; &amp;Otilde;, &otilde; &amp;otilde;, &otimes; &amp;otimes;, &Ouml; &amp;Ouml;, &ouml; &amp;ouml;, &para; &amp;para;, &part; &amp;part;, &permil; &amp;permil;, &perp; &amp;perp;, &Phi; &amp;Phi;, &phi; &amp;phi;, &Pi; &amp;Pi;, &pi; &amp;pi;, &piv; &amp;piv;, &plusmn; &amp;plusmn;, &pound; &amp;pound;, &prime; &amp;prime;, &Prime; &amp;Prime;, &prod; &amp;prod;, &prop; &amp;prop;, &Psi; &amp;Psi;, &psi; &amp;psi;, &quot; &amp;quot;, &radic; &amp;radic;, &rang; &amp;rang;, &raquo; &amp;raquo;, &rarr; &amp;rarr;, &rArr; &amp;rArr;, &rceil; &amp;rceil;, &rdquo; &amp;rdquo;, &real; &amp;real;, &reg; &amp;reg;, &rfloor; &amp;rfloor;, &Rho; &amp;Rho;, &rho; &amp;rho;, &rlm; &amp;rlm;, &rsaquo; &amp;rsaquo;, &rsquo; &amp;rsquo;, &sbquo; &amp;sbquo;, &Scaron; &amp;Scaron;, &scaron; &amp;scaron;, &sdot; &amp;sdot;, &sect; &amp;sect;, &shy; &amp;shy;, &Sigma; &amp;Sigma;, &sigma; &amp;sigma;, &sigmaf; &amp;sigmaf;, &sim; &amp;sim;, &spades; &amp;spades;, &sub; &amp;sub;, &sube; &amp;sube;, &sum; &amp;sum;, &sup; &amp;sup;, &sup1; &amp;sup1;, &sup2; &amp;sup2;, &sup3; &amp;sup3;, &supe; &amp;supe;, &szlig; &amp;szlig;, &Tau; &amp;Tau;, &tau; &amp;tau;, &there4; &amp;there4;, &Theta; &amp;Theta;, &theta; &amp;theta;, &thetasym; &amp;thetasym;, &thinsp; &amp;thinsp;, &THORN; &amp;THORN;, &thorn; &amp;thorn;, &tilde; &amp;tilde;, &times; &amp;times;, &trade; &amp;trade;, &Uacute; &amp;Uacute;, &uacute; &amp;uacute;, &uarr; &amp;uarr;, &uArr; &amp;uArr;, &Ucirc; &amp;Ucirc;, &ucirc; &amp;ucirc;, &Ugrave; &amp;Ugrave;, &ugrave; &amp;ugrave;, &uml; &amp;uml;, &upsih; &amp;upsih;, &Upsilon; &amp;Upsilon;, &upsilon; &amp;upsilon;, &Uuml; &amp;Uuml;, &uuml; &amp;uuml;, &weierp; &amp;weierp;, &Xi; &amp;Xi;, &xi; &amp;xi;, &Yacute; &amp;Yacute;, &yacute; &amp;yacute;, &yen; &amp;yen;, &yuml; &amp;yuml;, &Yuml; &amp;Yuml;, &Zeta; &amp;Zeta;, &zeta; &amp;zeta;, &zwj; &amp;zwj;, &zwnj; &amp;zwnj;.

- (Jim Gettman)

--

Peter Blaise responds:

THANKS Jim! How about in table form, also?


 * -- Peter Blaise peterblaise 15:51, 21 June 2007 (UTC)

Mozilla browser column formatting - does not render in IE, not appropriate for majority of MediaWiki users
-- by 2007-07-03T06:28:45 89.0.49.209

Add infobox to wikipage
how do i add the "infobox" extension (is infobox an extension?) to my wikipage? i tried to search but i couldnt find it.. i want to make the 'biography page' but i cant seem to find the "right-aligned-box" that can display pictures, info etc.. how do i do this? and my toolbox also limited.. how do i add more buttons? such as tables etc2..

--Hailmunan 01:37, 5 July 2007 (UTC)

Level 1
Isn't there also a =Level 1= layer. It's not on the formatting page. --Wayne (13:00 UTC 8 Aug 2007)


 * Yes, there is such a level. I added a note describing how its use is discouraged. I was trying not to clutter the document by using a footnote but please improve on my edit if you can. -Jarsyl 00:34, 27 August 2007 (UTC)

So? Is ONE = recommend or not? Why the page still contain the example with = when it's not recomment?
 * NOT recommended because =Level 1= creates an HTML &lt;h1>Section name&lt;/h1> heading. MediaWiki already puts the page name into an &lt;h1> heading. Everything else on the page is under that page name--subordinate to that level--and should not duplicate it. So section headings should start with ==Level 2==, which creates &lt;h2>section headings&lt;/h2>. You can use =Level 1= but shouldn't for this reason. Page updated accordingly. --Rogerhc 22:07, 20 January 2011 (UTC)

Numbering and Levels/sections
Is there a way to have sections autonumber? ie for the # and === type headers to combine? --7a 11:51, 4 May 2009 (UTC)
 * Perhaps reference could be made to the user preference (under miscellaneous options) for this here?

some, but not all HTML tags
I want to enable tags like &lt;abbr&gt;, &lt;acronym&gt;, and &lt;fieldset&gt; HTML tags but not all HTML tags. How can I do this? —Eek 05:20, 14 September 2007 (UTC)


 * Well, since no one responded, I went looking on my own and just added them to ..includes/Sanitzer.php. —Eek 07:41, 16 September 2007 (UTC)

Headings of different sizes
Wouldn't it be better to call that Headings of different levels? Type size is a stylesheet matter. Level is a markup matter. RoySmith 12:30, 12 October 2007 (UTC)


 * Good idea. I changed it to that based on your suggestion. --Lance E Sloan 15:30, 20 November 2007 (UTC)

Alternative To HTML BR Tags
I think the formatting should allow an alternative to using the  HTML tag for making list items span multiple lines. One of the things that many people like about wikis is the lack of HTML tags for most formatting. That makes formatting seem "simpler", at least for people who don't know HTML. It would be nice to extend that as much as possible. --Lance E Sloan 17:43, 16 November 2007 (UTC)

Add Monospace Formatting?
I think the page should include an example of monospace formatting, with &lt;tt&gt;. I also think that there should be some kind of formatting for monospace that doesn't require the use of HTML tags. How does one go about proposing a new format string and getting it accepted/approved by the MediaWiki maintainers? --Lance E Sloan 16:09, 5 December 2007 (UTC)

Closing HTML tag not parsed as HTML?
Dear,

I am having Mediawiki v1.11.0 on my local network.. and whenever i put some closing html tags in my page like  without its opening tag, the closing tag is displayed as is (converted to normal text and not acting as html tag). My wiki is in Arabic language. This usually happen since i have some templates that has the opening tag and the other template has the closing tag. somthing like:

=    = Bla Bla Bla =

then having a page with the contents

end up like this displayed in that page. Bla Bla Bla

Is this a bug?! or a sitting or something else? please help. --212.71.37.74 12:28, 14 December 2007 (UTC)


 * I can well imagine that the Mediawiki parser will not let you get away with these kinds of tricks. I guess the parser is resolving the 'header' template first, and deciding that there's a open div with a missing close div, so that gets added automatically somewhere higher up. Then when it gets to the footer template, it encounters close div but no open div, so it spits that out as plain text.
 * Basically it wont let you do that kind of thing, because of the various checks it does to ensure complete and correct HTML output. Mediawiki deliberately does not give you full HTML level flexibility, in order to be robust against users accidentally or maliciously outputting bad HTML.
 * A workaround I can think of, would be to write a little extension (bit of php code) which does nothing but output the raw HTML you want (just a start div, and another one outputing the end div). Bit of messy solution perhaps.
 * -- Harry Wood 11:35, 17 December 2007 (UTC)

Wiki Formatting Should Not Parse HTML - with the exception of sanitizing unwanted tags
I've been fighting with MediaWiki to create a template for showing the contents for a linux config file. The template basically shows a div containing the filename and an area showing the contents of that file.

Here's where the problems begin... Normally a pre tag would be the best scenario for this as the text file can be pasted in without having to add break tags. e.g.

However since MediaWiki parses HTML tags it sees the pre tag and then ignore the wiki code inside the pre tag.

Round two: My next attempt was to put it in a div tag. . Now since this was a linux config file comments begin with a # character. MediaWiki Was seeing this as a Numbered List and formatting it as such. Also since this was no longer preformatted text the text had to be modified to include a line break at the end of every line. the nowiki tag obviously cannot be used to fix this problem as the parameter would not get parsed.

Round three: In the end I had to rewrite the data to as it was being inputted as a parameter to include the nowiki tag and line breaks. Leading a mess.

Here's now how the template is being called:


 * To insert a number character # at a line beginning, I found that the following works:

&amp;#x23;
 * MediaWiki will render this as an # and not as a numbered list. --80.134.29.48 08:36, 10 April 2010 (UTC)

Extra single quote marks on save.
For some reason, I am getting extra single quotation marks when I save something. Assume I make something bold, i.e., surround it with 3 sets of single quotes. When I save the page, it becomes bold, italic and quoted (6 sets of quotes). If I edit and save again, the number of single quotes around each marked up item doubles. I presume that I have some setting or other which causes this. Anyone have any ideas? Susan 12:00, 28 August 2009 (UTC)

environment needed for some special html commands?
I tried to use a command in order to embed a google document table gadget in a mediawiki page. Although we changed $wgRawHtml = true (it is a closed wiki, and we greatly trust all our 15 users), the command was not interpreted and the source code appeared on the wiki-page instead. it took me hours to find out that apparently, the command has to be embedded in a environment in order to be interpreted: ... Wikitext ...    ...   ... Wikitext ... why this? which html-commands are interpreted without environment and which ones are not? i could not find any documentation on it, and i think it is important to be documented here!

So I suggest to make a table of all html commands, and note for each command: Or are these two conditions identical? --Jami 18:18, 3 December 2009 (UTC)
 * 1) if the command is interpreted only with $wgRawHtml = true, and
 * 2) if the command is interpreted only if it is embedded into a environment.
 * $wgRawHtml controls if &lt;html&gt; sections are enabled or not. Any code outside an &lt;html&gt; is interpreted the same regardless of if raw html is on. Since raw html is disabled by default, and most users would keep it disabled, I don't think discussion about that option belongs on this page, but instead on the manual:$wgRawHtml page. Bawolff 22:25, 21 October 2010 (UTC)

Mistake?
Which of the following is 'correct'?


 * and

or


 * and

?

Full HMTL escaping
In developing my wiki, i ran into a problem where i was using the "& + nbsp;" but was unable to escape the parsing of the HTML markup. Any suggestions? Goldbishop 13:34, 25 July 2010 (UTC)
 * I propose  or an image file. JackPotte 19:37, 25 July 2010 (UTC)
 * &amp;nbsp; ? Bawolff 22:17, 21 October 2010 (UTC)

"equation marks"?
Shouldn't it be "equality marks" (or "equality signs") instead of "equation marks" in the text below (is in the beginning of the article)?


 * ... characters like asterisks, single quotes or equation marks ...

--109.59.209.195 21:50, 21 October 2010 (UTC)
 * changed. Btw you can directly edit the page too. Bawolff 22:21, 21 October 2010 (UTC)

Modify Mediawiki's markup language
I want to modify existing mediawiki's markup language, for example the background and text color of ==title== output. Where is mediawiki's markup language is stored so that I can edit the outputs? Or, maybe there is extension that will allow easier way of editing existing mediawiki's markup language? Any help is appreciated.


 * MediaWiki's markup "==" is translated to HTML's element. The background and text color of are defined in the CSS file of each skin, and that is where you'd change them. Hamilton Abreu 02:15, 7 November 2010 (UTC)


 * Thank you, it worked perfectly!

Where is the markup of # stored, I also want to modify the style of it?
 * Thats also stored in the CSS. # is translated into an ... . You can modify it by adding a rule like:

ol li { background-color:red; color: blue; border: black thin solid } In the page mediawiki:Common.css on your wiki. See manual:CSS. Bawolff 08:21, 26 December 2010 (UTC)

Ending a list item and continuing the containing item
The part about lists doesn't explain how to end a n-level list item and continue with the containing (n-1)-level item without creating a new (n-1)-level item, such as this:

- Item 1 - item 1.1 - item 1.2 continuing item 1 - Item 2

This can be done in plain html, so I guess there must be a way to do it in wiki syntax. If not, this should definitely be mentioned in the docs (and fixed in the implementation, but this is not the place to discuss that).

This page illustrates the problem, and mentions a wrong solution that does not work: http://meta.wikimedia.org/wiki/MediaWiki_List_Problem. Matteosistisette 20:25, 4 January 2011 (UTC)

br syntax
I have replaced &lt;br /> with &lt;br> : the HTML standards are all quite clear that the syntax is &lt;br> because it's an void element and needn't be closed. Under HTML5 the other form is only an optional form to use when one needs to maintain compatibility with XHTML 1.0. Anyone who is trying to maintain compatibility with XHTML doesn't need us to explain it.--Doug 22:54, 11 August 2011 (UTC)

Should we really be suggesting deprecated HTML?
&lt;u> underline &lt;/u>; &lt;s> strikethrough &lt;/s> and its variant &lt;strike> strikethrough &lt;/strike> are all deprecated with HTML 4.0. Should we really be presenting these here to be used?--Doug 23:15, 11 August 2011 (UTC)


 * If &lt;u>, &lt;s>, and &lt;strike> are deprecated, they shouldn't be recommended. Replace the documentation of the deprecated tags with the alternatives, &lt;ins> and &lt;del>.  Personally, I think that the use of HTML tags in wikis should be avoided.  For underline and strikethrough, I wish MediaWiki supported syntax like _underlined_ and -strikethrough-.  The wiki could then render it as text wrapped with span tags that use the appropriate style for each, like "text-decoration:line-through;" for strikethrough.  --Lance E Sloan 14:46, 12 August 2011 (UTC)


 * I generally agree that more wikitext possibilities are better than using html; however, I work on wikisource and I do a lot of cross-subdomain (i.e. multilingual) texts. Currently the only way to ensure compatibility between subdomains is to use html.  Templates (and, even worse, shortcuts to templates) don't translate well. I'll make the changes to the page.  ;-)--Doug 16:03, 12 August 2011 (UTC)


 * So you mean that if one wiki supported a syntax like the one I suggest, but others don't, authors like you would run into compatibility problems, right? I agree that's a problem, but I think it's not a major problem.  If an extension for the syntax were easy to install or if the syntax were part of core MediaWiki and the wikis could be upgraded, sysadmins could make it available to users quickly.  I also think of these suggestions as additions to the current syntax, not replacements.  I think I'm taking this conversation in the wrong direction, though.  You're asking about something practical and I'm dreaming about something theoretical.  I'll be quiet now.  :) --Lance E Sloan 17:14, 12 August 2011 (UTC)


 * I thought you had a great idea, I just didn't say so ;-). More Wikitext supported by the software and fewer templates created to implement html and css easily.  HTML in the middle of a text one is editing is no fun, css is even less fun, templates are OK, but wikimarkup is really nice.  The problem is too many templates so they become duplicative or they conflict across subdomains.  I only meant that in the absence of that HTML/CSS is the only solution.--Doug 17:33, 12 August 2011 (UTC)


 * Yes, you're right about that. I'm glad you like the idea.  I wonder what's the correct place to suggest additions to wikitext.  --Lance E Sloan 18:21, 12 August 2011 (UTC)


 * I just asked on IRC and was told: "https://lists.wikimedia.org/mailman/listinfo/wikitext-l is one, I know others will suggest other places, such as bugzilla bugs marked "newparser"". Let me know if you put something up.  I can see "_" and "-" being problematic possibly, the former being common in urls and the latter being just common - but maybe they could be used.  There are lots of symbols that rarely or never show up in series that could be doubled the way single quotes are.--Doug 18:36, 12 August 2011 (UTC)


 * Thanks! I'll look at the mailing list.  Your change to the formatting help page is good.  I made a couple minor changes, too.  --Lance E Sloan 18:54, 12 August 2011 (UTC)


 * Thanks for tweaking my edits. Now I've realized I need to put that all in to the other languages best I can. Ugh! --Doug 18:48, 12 August 2011 (UTC)


 * You're welcome. Good luck with the translations.  --Lance E Sloan 18:54, 12 August 2011 (UTC)

Add cabability to suppress automatic contents list
The contents list is automatically generated if more than 4 headings. This is usually very useful, and each user can hide. However, it would be useful to be able to suppress this, either because where it is automatically generated or to provide an alternative.

The case I currently have is headings which are the alphabet, and all 26 do not appear without scrolling because of an opening description. I can create a single line index at the top of the page but still have the other contents list, which looks badly designed. (I can also repeat the single line index later in the page to help navigation) Something like the "hiddencat" ability would be great, but can't find any reference to this as an existing feature.

Note that I do not want to use a Category because of the details under each letter, or as separate pages to allow the user to scroll down

Chris
 * Hiding the table of contents: check the manual --Lance E Sloan 15:13, 10 November 2011 (UTC)