Help talk:Formatting

From mediawiki.org
Latest comment: 1 year ago by PluralGrey in topic Formatting examples are confusing.

Extend wiki markups with only one extra new markup[edit]

Hi, I would like to extend wiki markups with this simple one:

Wiki text: *something cool* ==> html output: <em>something cool</em>

What is the easiest way? Is it possible without extension? Any idea where to start?

Many thanks :)

--CoolCornucopia (talk) 14:44, 5 January 2017 (UTC)Reply

$wgRawHtml[edit]

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)Reply

Yes Wvtammylinn (talk) 03:23, 11 November 2016 (UTC)Reply

Tables[edit]

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)Reply
46.130.131.143 12:14, 21 June 2016 (UTC) go advanced → click that table, and put table. Thanks (*_*)Reply

What About An HTML Symbols Guide?[edit]

As an HTML duffer :Þ 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;, á &aacute;,  &Acirc;, â &acirc;, ´ &acute;, Æ &AElig;, æ &aelig;, À &Agrave;, à &agrave;, ℵ &alefsym;, Α &Alpha;, α &alpha;, & &amp;, ∧ &and;, ∠ &ang;, Å &Aring;, å &aring;, ≈ &asymp;, à&Atilde;, ã &atilde;, Ä &Auml;, ä &auml;, „ &bdquo;, Β &Beta;, β &beta;, ¦ &brvbar;, • &bull;, ∩ &cap;, Ç &Ccedil;, ç &ccedil;, ¸ &cedil;, ¢ &cent;, Χ &Chi;, χ &chi;, ˆ &circ;, ♣ &clubs;, ≅ &cong;, © &copy;, ↵ &crarr;, ∪ &cup;, ¤ &curren;, † &dagger;, ‡ &Dagger;, ↓ &darr;, ⇓ &dArr;, ° &deg;, Δ &Delta;, δ &delta;, ♦ &diams;, ÷ &divide;, É &Eacute;, é &eacute;, Ê &Ecirc;, ê &ecirc;, È &Egrave;, è &egrave;, ∅ &empty;,   &emsp;,   &ensp;, Ε &Epsilon;, ε &epsilon;, ≡ &equiv;, Η &Eta;, η &eta;, Р&ETH;, ð &eth;, Ë &Euml;, ë &euml;, € &euro;, ∃ &exist;, ƒ &fnof;, ∀ &forall;, ½ &frac12;, ¼ &frac14;, ¾ &frac34;, ⁄ &frasl;, Γ &Gamma;, γ &gamma;, ≥ &ge;, > &gt;, ↔ &harr;, ⇔ &hArr;, ♥ &hearts;, … &hellip;, Í &Iacute;, í &iacute;, Π&Icirc;, î &icirc;, ¡ &iexcl;, Ì &Igrave;, ì &igrave;, ℑ &image;, ∞ &infin;, ∫ &int;, Ι &Iota;, ι &iota;, ¿ &iquest;, ∈ &isin;, Ï &Iuml;, ï &iuml;, Κ &Kappa;, κ &kappa;, Λ &Lambda;, λ &lambda;, ⟨ &lang;, « &laquo;, ← &larr;, ⇐ &lArr;, ⌈ &lceil;, “ &ldquo;, ≤ &le;, ⌊ &lfloor;, ∗ &lowast;, ◊ &loz;, ‎ &lrm;, ‹ &lsaquo;, ‘ &lsquo;, < &lt;, ¯ &macr;, — &mdash;, µ &micro;, · &middot;, − &minus;, Μ &Mu;, μ &mu;, ∇ &nabla;,   &nbsp;, – &ndash;, ≠ &ne;, ∋ &ni;, ¬ &not;, ∉ &notin;, ⊄ &nsub;, Ñ &Ntilde;, ñ &ntilde;, Ν &Nu;, ν &nu;, Ó &Oacute;, ó &oacute;, Ô &Ocirc;, ô &ocirc;, Œ &OElig;, œ &oelig;, Ò &Ograve;, ò &ograve;, ‾ &oline;, Ω &Omega;, ω &omega;, Ο &Omicron;, ο &omicron;, ⊕ &oplus;, ∨ &or;, ª &ordf;, º &ordm;, Ø &Oslash;, ø &oslash;, Õ &Otilde;, õ &otilde;, ⊗ &otimes;, Ö &Ouml;, ö &ouml;, ¶ &para;, ∂ &part;, ‰ &permil;, ⊥ &perp;, Φ &Phi;, φ &phi;, Π &Pi;, π &pi;, ϖ &piv;, ± &plusmn;, £ &pound;, ′ &prime;, ″ &Prime;, ∏ &prod;, ∝ &prop;, Ψ &Psi;, ψ &psi;, " &quot;, √ &radic;, ⟩ &rang;, » &raquo;, → &rarr;, ⇒ &rArr;, ⌉ &rceil;, ” &rdquo;, ℜ &real;, ® &reg;, ⌋ &rfloor;, Ρ &Rho;, ρ &rho;, ‏ &rlm;, › &rsaquo;, ’ &rsquo;, ‚ &sbquo;, Š &Scaron;, š &scaron;, ⋅ &sdot;, § &sect;, ­ &shy;, Σ &Sigma;, σ &sigma;, ς &sigmaf;, ∼ &sim;, ♠ &spades;, ⊂ &sub;, ⊆ &sube;, ∑ &sum;, ⊃ &sup;, ¹ &sup1;, ² &sup2;, ³ &sup3;, ⊇ &supe;, ß &szlig;, Τ &Tau;, τ &tau;, ∴ &there4;, Θ &Theta;, θ &theta;, ϑ &thetasym;,   &thinsp;, Þ &THORN;, þ &thorn;, ˜ &tilde;, × &times;, ™ &trade;, Ú &Uacute;, ú &uacute;, ↑ &uarr;, ⇑ &uArr;, Û &Ucirc;, û &ucirc;, Ù &Ugrave;, ù &ugrave;, ¨ &uml;, ϒ &upsih;, Υ &Upsilon;, υ &upsilon;, Ü &Uuml;, ü &uuml;, ℘ &weierp;, Ξ &Xi;, ξ &xi;, Ý &Yacute;, ý &yacute;, ¥ &yen;, ÿ &yuml;, Ÿ &Yuml;, Ζ &Zeta;, ζ &zeta;, ‍ &zwj;, ‌ &zwnj;.
- (Jim Gettman)

--

Peter Blaise responds:

THANKS Jim! How about in table form, also?

Á &Aacute; á &aacute;  &Acirc; â &acirc;
´ &acute; Æ &AElig; æ &aelig; À &Agrave;
à &agrave; ℵ &alefsym; Α &Alpha; α &alpha;
& &amp; ∧ &and; ∠ &ang; Å &Aring;
å &aring; ≈ &asymp; à&Atilde; ã &atilde;
Ä &Auml; ä &auml; „ &bdquo; Β &Beta;
β &beta; ¦ &brvbar; • &bull; ∩ &cap;
Ç &Ccedil; ç &ccedil; ¸ &cedil; ¢ &cent;
Χ &Chi; χ &chi; ˆ &circ; ♣ &clubs;
≅ &cong; © &copy; ↵ &crarr; ∪ &cup;
¤ &curren; † &dagger; ‡ &Dagger; ↓ &darr;
⇓ &dArr; ° &deg; Δ &Delta; δ &delta;
♦ &diams; ÷ &divide; É &Eacute; é &eacute;
Ê &Ecirc; ê &ecirc; È &Egrave; è &egrave;
∅ &empty;   &emsp;   &ensp; Ε &Epsilon;
ε &epsilon; ≡ &equiv; Η &Eta; η &eta;
Р&ETH; ð &eth; Ë &Euml; ë &euml;
€ &euro; ∃ &exist; ƒ &fnof; ∀ &forall;
½ &frac12; ¼ &frac14; ¾ &frac34; ⁄ &frasl;
Γ &Gamma; γ &gamma; ≥ &ge; > &gt;
↔ &harr; ⇔ &hArr; ♥ &hearts; … &hellip;
Í &Iacute; í &iacute; Π&Icirc; î &icirc;
¡ &iexcl; Ì &Igrave; ì &igrave; ℑ &image;
∞ &infin; ∫ &int; Ι &Iota; ι &iota;
¿ &iquest; ∈ &isin; Ï &Iuml; ï &iuml;
Κ &Kappa; κ &kappa; Λ &Lambda; λ &lambda;
⟨ &lang; « &laquo; ← &larr; ⇐ &lArr;
⌈ &lceil; “ &ldquo; ≤ &le; ⌊ &lfloor;
∗ &lowast; ◊ &loz; ‎ &lrm; ‹ &lsaquo;
‘ &lsquo; < &lt; ¯ &macr; — &mdash;
µ &micro; · &middot; − &minus; Μ &Mu;
μ &mu; ∇ &nabla;   &nbsp; – &ndash;
≠ &ne; ∋ &ni; ¬ &not; ∉ &notin;
⊄ &nsub; Ñ &Ntilde; ñ &ntilde; Ν &Nu;
ν &nu; Ó &Oacute; ó &oacute; Ô &Ocirc;
ô &ocirc; Œ &OElig; œ &oelig; Ò &Ograve;
ò &ograve; ‾ &oline; Ω &Omega; ω &omega;
Ο &Omicron; ο &omicron; ⊕ &oplus; ∨ &or;
ª &ordf; º &ordm; Ø &Oslash; ø &oslash;
Õ &Otilde; õ &otilde; ⊗ &otimes; Ö &Ouml;
ö &ouml; ¶ &para; ∂ &part; ‰ &permil;
⊥ &perp; Φ &Phi; φ &phi; Π &Pi;
π &pi; ϖ &piv; ± &plusmn; £ &pound;
′ &prime; ″ &Prime; ∏ &prod; ∝ &prop;
Ψ &Psi; ψ &psi; " &quot; √ &radic;
⟩ &rang; » &raquo; → &rarr; ⇒ &rArr;
⌉ &rceil; ” &rdquo; ℜ &real; ® &reg;
⌋ &rfloor; Ρ &Rho; ρ &rho; ‏ &rlm;
› &rsaquo; ’ &rsquo; ‚ &sbquo; Š &Scaron;
š &scaron; ⋅ &sdot; § &sect; ­ &shy;
Σ &Sigma; σ &sigma; ς &sigmaf; ∼ &sim;
♠ &spades; ⊂ &sub; ⊆ &sube; ∑ &sum;
⊃ &sup; ¹ &sup1; ² &sup2; ³ &sup3;
⊇ &supe; ß &szlig; Τ &Tau; τ &tau;
∴ &there4; Θ &Theta; θ &theta; ϑ &thetasym;
  &thinsp; Þ &THORN; þ &thorn; ˜ &tilde;
× &times; ™ &trade; Ú &Uacute; ú &uacute;
↑ &uarr; ⇑ &uArr; Û &Ucirc; û &ucirc;
Ù &Ugrave; ù &ugrave; ¨ &uml; ϒ &upsih;
Υ &Upsilon; υ &upsilon; Ü &Uuml; ü &uuml;
℘ &weierp; Ξ &Xi; ξ &xi; Ý &Yacute;
ý &yacute; ¥ &yen; ÿ &yuml; Ÿ &Yuml;
Ζ &Zeta; ζ &zeta; ‍ &zwj; ‌ &zwnj;
-- Peter Blaise peterblaise 15:51, 21 June 2007 (UTC)Reply

Mozilla browser column formatting - does not render in IE, not appropriate for majority of MediaWiki users[edit]

Description You type You get
Double Column Layout <div style="-moz-column-count:2; column-count:2;"> * first col, item A * first col, item B * second col, item A * second col, item B </div>
  • first col, item A
  • first col, item B
  • second col, item A
  • second col, item B

-- by 2007-07-03T06:28:45 89.0.49.209
This can be solved by adding 3 lines of CSS to cover most (if not all) browsers.
.columns { -webkit-column-count:3; /* Chrome, Safari, Opera */ -moz-column-count:3; /* Firefox */ column-count:3;
I've added a class definition into my Common.css so that anyone can add 3 column divs to a wiki page anytime they want, without having to redefine the CSS inline as such.
--Vicious the Jester (talk) 14:23, 25 April 2014 (UTC)Reply

Add infobox to wikipage[edit]

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)Reply

Levels[edit]

Level 1[edit]

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)Reply

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 <h1>Section name</h1> heading. MediaWiki already puts the page name into an <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 <h2>section headings</h2>. You can use =Level 1= but shouldn't for this reason. Page updated accordingly. --Rogerhc 22:07, 20 January 2011 (UTC)Reply

Not that if you used level1 tags and need to have h1 being output as h2, you can make this patch by editing file includes/Linker.php. Replace:

return "<h$level$attribs"
                       . "$fallback$html"
                       . $link
                       . "</h$level>";

with

return "<h".($level+1)."$attribs"
                       . "$fallback$html"
                       . $link
                       . "</h".($level+1).">";

Numbering and Levels/sections[edit]

Is there a way to have sections autonumber? ie for the # and === type headers to combine? --7a 11:51, 4 May 2009 (UTC)Reply

Perhaps reference could be made to the user preference (under miscellaneous options) for this here?

Some, but not all HTML tags[edit]

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

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)Reply

Headings of different sizes[edit]

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)Reply

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

Alternative To HTML BR Tags[edit]

I think the formatting should allow an alternative to using the <br> 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)Reply

46.130.138.196 12:33, 25 June 2016 (UTC) <br> is allowed in MediaWiki (MW). <br /> uses 2 more characters than simpler <br>.Reply

Add Monospace Formatting?[edit]

I think the page should include an example of monospace formatting, with <tt>. 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)Reply

--46.130.131.143 11:08, 21 June 2016 (UTC) Teletype text is possible. Most HTML tags can be used in Wikimarkup. Just type <tt>Teletype text</tt> to get a Teletype textReply

Closing HTML tag not parsed as HTML?[edit]

Dear,

I am having MediaWiki v1.11.0 on my local network.. and whenever i put some “closing” MTML tags in my page like </div> 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. something like:

{{Header}} = <div>
{{Body}} = Bla Bla Bla
{{Footer}} = </div>

then having a page with the contents

{{Header}}{{Body}}{{Footer}} 

end up like this displayed in that page.

Bla Bla Bla</div>

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

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 (</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)Reply

Wiki Formatting Should Not Parse HTML - with the exception of sanitizing unwanted tags[edit]

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. <pre>{{{2}}}</pre>

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. <div style="font-family: monospace">{{{2}}}</div>. 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 {{{2}}} 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:

{{Box File|/target/etc/apt/sources.list| <nowiki>deb http://ie.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse </nowiki><br />
<nowiki>deb-src http://ie.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse</nowiki><br />
<br />
<nowiki>deb http://ie.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse </nowiki><br />
<nowiki>deb-src http://ie.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse </nowiki><br />
<br />
<nowiki>deb http://security.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse </nowiki><br />
<nowiki>deb-src http://security.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse </nowiki><br />
<br /><br /> <nowiki># deb http://ie.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse </nowiki><br />
<nowiki># deb-src http://ie.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse </nowiki><br />
<br />
<nowiki># deb http://archive.canonical.com/ubuntu hardy partner </nowiki><br />
<nowiki># deb-src http://archive.canonical.com/ubuntu hardy partner</nowiki><br /><br />
<nowiki>deb http://ppa.launchpad.net/ubuntu-mobile/ubuntu hardy main restricted universe</nowiki><br />
<nowiki>deb-src http://ppa.launchpad.net/ubuntu-mobile/ubuntu hardy main restricted universe</nowiki>
}}

To insert a number character # at a line beginning, I found that the following works:
&#x23;
MediaWiki will render this as an # and not as a numbered list. --80.134.29.48 08:36, 10 April 2010 (UTC)Reply


46.130.131.143 11:40, 21 June 2016 (UTC) No, don't remove HTML from Wikimarkup. Wikimarkup is a simpler, altered version of HTML, with added alts for many tags like ''Italic'' for Italic.Reply


195.212.29.86 11:57, 5 January 2018 (UTC): Argh! I just hit this same problem! Seems we need some way of turning off the parsing while the tempalte is being processed, so that parts of the template are not parsed during the transliteration process.Reply

There are a couple of workarounds. The simplest solution is probably not to depend on templates and paste the raw text directly, e.g.:

 <div>my html goes here
# my other stuff

Or alternatively use nowiki from within Extension:Scribunto to prevent the argument from expanding. Finally, another solution is to create a page for the content, paste it there, and then transclude it with a parser function, e.g.: {{msgnw:User:Boo/boo.txt}}. This can be even better if you change the contentmodel of the page (boo.txt) to be simply "text". 13:13, 5 January 2018 (UTC)

Extra single quote marks on save.[edit]

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)Reply

46.130.131.143 11:44, 21 June 2016 (UTC) You can use HTML <nowiki> tag to stop any markup, including HTML tags, or use any other quotation marks, like ‘‘This’’, without formatting markup, or use "This" , also prevents emphasizes (the Bold and Italic).Reply

<html> environment needed for some special html commands?[edit]

I tried to use a <script> 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 <script> command was not interpreted and the source code appeared on the wiki-page instead. it took me hours to find out that apparently, the <script> command has to be embedded in a <html> environment in order to be interpreted:

  ... Wikitext ...
  <html>
    <script ...> ... </script>
  </html>
  ... Wikitext ...

why this? which html-commands are interpreted without <html> 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:

  1. if the command is interpreted only with $wgRawHtml = true, and
  2. if the command is interpreted only if it is embedded into a <html> environment.

Or are these two conditions identical? --Jami 18:18, 3 December 2009 (UTC)Reply

$wgRawHtml controls if <html> sections are enabled or not. Any code outside an <html> 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)Reply

Mistake?[edit]

Which of the following is 'correct'?

:* and :#

or

*: and #:

?

Answer: The second is the correct!46.130.137.111 17:31, 21 July 2016 (UTC)Reply

Full HTML escaping[edit]

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)Reply

I propose &nbsp; or an image file. JackPotte 19:37, 25 July 2010 (UTC)Reply
Use “Special Characters”, use <nowiki>. 46.130.131.143 12:08, 21 June 2016 (UTC)Reply
&nbsp; ? Bawolff 22:17, 21 October 2010 (UTC)Reply

"equation marks"?[edit]

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)Reply

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

Modify MediaWiki's markup language[edit]

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 <h2> element. The background and text color of <h2> 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)Reply
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 <ol><li>.... 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)Reply

Ending a list item and continuing the containing item[edit]

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).

These like - Item 1 is for Markdown, not Wikimarkup.

This page illustrates the problem, and mentions a wrong solution that does not work: m:MediaWiki List Problem . Matteosistisette 20:25, 4 January 2011 (UTC)Reply

Is this what you want?
  1. Item 1
    1. item 1.1
    2. item 1.2
    continuing item 1
  2. Item 2
Here's the code for that:
# Item 1
## item 1.1
## item 1.2
#: continuing item 1
# Item 2
Hope it helps!
Rbirmann (talk) 16:18, 7 October 2016 (UTC)Reply

< /> syntax[edit]

I have replaced <br /> with <br> : the HTML standards are all quite clear that the syntax is <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)Reply

Should we really be suggesting deprecated HTML?[edit]

<u>underline</u>; <s>strikethrough</s> and its variant <strike>strikethrough</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)Reply

If <u>, <s>, and <strike> are deprecated, they shouldn't be recommended. Replace the documentation of the deprecated tags with the alternatives, <ins> for underline and <del>. Personally, I think that the use of HTML tags in wikis should be avoided. For underline, overline and strikethrough, I wish MediaWiki supported syntax like __underlined__, ¯¯Overline¯¯ 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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
You're welcome (*_*). Good luck with the translations. --Lance E Sloan 18:54, 12 August 2011 (UTC)Reply

Add cabability to suppress automatic contents list[edit]

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)Reply

Converting lists to tabular columns[edit]

Some Wikipedia lists are long and narrow, eg. List of Pinewood Studios productions. It would be nice to have an option to convert them into a tabular grid list, which I think I can be done with just CSS2, eg li {display:inline-block;width:75px}. See the result here on JSfiddle. This could be done easily by adding a <DIV id="listab"> tag at the beginning of the page, if it were supported by the global CSS. --Iantresman 20:40, 20 December 2011 (UTC)Reply

Escape wiki markup once[edit]

It will work?--wargo (talk) 20:15, 8 May 2012 (UTC)Reply

Bullets and numbering interfering with tables[edit]

Please see this example where a bulleted list is formatting badly next to a table. There are also examples where numbering is doing something similar. What's happening?--IBobi (talk) 20:40, 5 November 2012 (UTC)Reply

Translations[edit]

Quim proposed to make this page translatable. I'm not sure it's a good idea, because now this page is superseded by the advanced toolbar. Can we manage to include the translations on this page?[1] There's also plenty of other copies of this cheatsheet, like Meta, translated PDFs on Commons, all sorts of fliers, pretty much every Wikimedia project's help namespace, ... but WikiEditor's is the only up to date copy because it's maintained via the Translate extension on translatewiki.net. --Nemo 17:54, 24 December 2012 (UTC)Reply

formatting question[edit]

I need to write a caret notation in italic.


Numbered lists question[edit]

I would like to create a numbered list following this schema:

1. Section header 1
  1.1. Paragraph 1
  1.2. Paragraph 2
  1.3. Paragraph 3

2. Section header 2
  2.1. Paragraph 1
  2.2. Paragraph 2
  2.3. Paragraph 3

etc.

I tried using # and ##, but it doesn't produce the desired format. In case is not possible using mediawiki syntax, perhaps could be achieved via CSS redefining <ol> <ul> and <li> tags.

Which options do you suggest to get such article structure? Thanks in advance.

We solved this by adding the following to Common.css
/* nested lists */
.nested ol {
  counter-reset: section;
  list-style-type: none;
}
.nested li:before {
  list-style-type: none;
  counter-increment: section;
  content: counters(section, ".") ". ";
}
And wrapping the list with <div class="nested">, such as this:
<div class="nested">
# Section header 1
## Paragraph 1
## Paragraph 2
# Section header 2
## Paragraph 1
## Paragraph 2
### Sub-paragraph X
## Etc.
</div>
Hope it helps.
Rbirmann (talk) 16:14, 7 October 2016 (UTC)Reply
Finding this was the best part of my week. - Lbillett (talk) 01:30, 5 November 2016 (UTC)Reply

Formating the edit page toolbar[edit]

Can anyone tell me where can I find the page that formates the toolbar at the head of the edit page?

format sequence space followed by asterisk[edit]

I can't find the following covered by the article:

* Beginning the line with a space followed by an asterisk turns me into some kind of box (while still displaying the space and asterisk as you'd expect)

I looked around but could not find coverage of this particular feature. If this is covered somewhere (preferably on the English Wikipedia) I'd appreciate a link. I'd like to understand why I can't find this documented in the usual places... Cheers, CapnZapp (talk) 10:44, 10 June 2014 (UTC)Reply

Using an image as a heading?[edit]

Not sure if this is the right place to ask this, but: I'm currently in the midst of setting up a small wiki for a gaming group, and need to transfer character sheets from a forum (PHPBB). For the most part, it's fairly straightforward, but some of the community members like to use images (Like this) as headings.

I'm essentially wondering if it's possible to create a header whose title/name doesn't actually appear in the body of the page, as trying to just make the text the same colour as the background makes things look lopsided.

74.12.126.64 22:30, 22 October 2014 (UTC)Reply

Cheatsheet[edit]

Partially a pointer, in case anyone hasn't seen it.... I'd suggest copying (adapting) enwiki's w:WP:CHEATSHEET over to this wiki, and considering using that as the main wikitext help landing page. It contains all (?) the important bits, in a single short page, rather than the current split that we have here of multiple pages to cover just the basics (links, formatting, images, lists, ...). I haven't had time to properly research the history of this page (and the related Help:Contents pages), so I'm just hesitantly suggesting for now. Quiddity (WMF) (talk) 22:26, 19 March 2015 (UTC)Reply

source versus pre tags[edit]

<source lang="trac-wiki"> </source>

I noticed this being used instead of <pre> </pre> tags. See this diff.

It looks interesting in that it uses syntax highlighting too. Where is there more info on this? I would like to see it added to the article here. --Timeshifter (talk) 19:44, 4 August 2015 (UTC)Reply

Inserting_symbols section error[edit]

The note in the Inserting_symbols section looks to be flipped.

It says: "Hover over any character to find out the symbol that it produces."

I believe it should be "Hover over any symbol to see the HTML entity that produces it."

The symbols are what are displayed. The character/HTML is what shows up when you hover.

Modify Wikimarkup[edit]

Gh2d2bvs2d (talk) 08:58, 5 July 2016 (UTC) I would like a extension which you have a new wikitext used in Wikis and forums!Reply

And also simplify the syntax


Emphasis[edit]

Bold
'''Bold''';;Bold;;
Italic
''Italic''''Italic''
Underline
<u>Underline</u>++Underline++</nowiki>
Strikeout
<s>Strikeout</s>``Strikeout``
Headlines (= <h1>, to ====== <h6>)
=Headline=#Headline
Line separator (use atleast 4 dashes)
---- + ____

Ordered lists[edit]

I think MediaWiki Markup Language (MWML) would use “WYSIWYG-style” ordered list markup (just like in Markdown), instead of hashes.

From:

#Ordered list with hashes
##Nested list

To:

1. “Real” Ordered lists
  1. Indentation

Hash signs are used for tags. Unicode has called the # character has called Number Sign. Thanks 46.130.135.195 19:24, 22 August 2016 (UTC)Reply

MediaWiki ignores single line breaks[edit]

Hi there. The fact that MediaWiki ignores single line breaks is proving to be the biggest single hurdle in the adoption of our private wiki by non-tech users. I can relate to that. All work-arounds (<br/>, double line break, lists, <poem>) seem suboptimal to me, and anyway they are just that, work-arounds.

Maybe I'm missing something obvious, but what is the historical reason for this design decision? I understand that it cannot be undone overnight without breaking existing contents, but is it not possible to optionaly change this behaviour? Are there really no extensions/mods that would in my view instantly improve MW's usability?

Thanks. 51.6.194.34 09:32, 26 August 2016 (UTC)Reply

How to add multiple formatting?[edit]

Stumbled across a problem, in a quote, where you want to use an in-line qualifier, like "I then told [President] Obama the news" but if you want to create a wiki-link inside that qualifier, in theory it would become [[[President]]] but wikipedia won't resolve that correctly. I tried inserting {{}} and <nowiki> but nothing seems to work. Suggestions? Shouldn't it be covered on this page? 64.128.162.11 21:08, 6 June 2019 (UTC)Reply

Embrace one starting and one ending with nowiki --wargo (talk) 21:19, 6 June 2019 (UTC)Reply

Does MediaWiki Have Cookie Rules?[edit]

What is the Mediawiki command to give a cookie to someone? PopMaster 22:17, 26 June 2021 (UTC)Reply

Update code to Python 3[edit]

Update code snippets to Python 3, Ilovemydoodle (talk) 22:15, 8 April 2022 (UTC)Reply

Formatting examples are confusing.[edit]

The Italic, Bold and Bold & Italic examples must not use the words "Italic," "Bold," or "Bold & Italic" in the example. It adds a variable: the new user doesn't know if the word "Italic" is required to make something italicized. Best practices is to have a single, short phrase (e.g., the brown dog) and repeat it for each example, thus demonstrating that it is the markings, not the words, that alters text. PluralGrey (talk) 07:09, 3 February 2023 (UTC)Reply