Talk:HTML5

From mediawiki.org
Latest comment: 10 years ago by Automatik in topic The output of WMF wikis is it full HTML5?

Text Editor[edit]

I always write all my articles in WordPad, and then change the syntax for MediaWiki and copy paste it. I know that in HTML5 the standard word processor functionality can be implemented into MediaWiki. It would also be great to have an easier way of adding pictures. I use a lot of pictures, but still I must keep looking up the syntax. The editor is one of the most important features of any Wiki. To be frank with you, with all due respect, the MediaWiki editor sucks.

Keeping this up to date[edit]

Just a little think which I think would help with this page. We should create a table with all goals that we have relating to HTML5, filling it in as we go along. This would help people know what goals have still yet to be completed on making MediaWiki HTML5 compliant. Would this be a welcome additon?

Puremation 13:29, 24 March 2011 (UTC)Reply

It's a wiki. Be bold. If someone dislikes your change, they'll fix it or revert it. —Simetrical (talk • contribs) 01:13, 25 March 2011 (UTC)Reply

A configuration setting?[edit]

It would be nice if we had something like a $wgUseHTML5, so other wiki operators can also make the decision easily.--Jasper Deng (talk) 01:23, 8 April 2012 (UTC)Reply

We have $wgHtml5, is that what you're after? Cheers, Grunny (talk) 05:10, 8 April 2012 (UTC)Reply
Yeah, that was what I was after. I'm going to add mention of this to the page.--Jasper Deng (talk) 05:10, 8 April 2012 (UTC)Reply

Data-* in MediaWiki 1.16[edit]

Is it possible to enable data-* attributes in 1.16?

I tried adding this to validateAttributes in sanitizer.php

# Allow any attribute beginning with "data-", if in HTML5 mode
if ( !($wgHtml5 && preg_match( '/^data-/i', $attribute )) && !isset( $whitelist[$attribute] ) ) {
				continue;
			}

I also tested adding 'data-anything' to the common whitelist but no attributes with hyphens work. Is there something else I need to do to keep attributes with hyphens from getting stripped out?

—The preceding unsigned comment was added by JuLara (talkcontribs18:17, 31 August 2012 (UTC)Reply

Named entities[edit]

I'd suggest continuing to allow the use of the legacy HTML4 named entities in wikitext, as things like   are just too convenient to lose -- but of course they should be converted to the appropriate numeric entities on conversion to HTML, in order to make the page itself valid HTML5. -- The Anome (talk) 15:48, 7 September 2012 (UTC)Reply

MediaWiki currently parses all the 253 named character entities in HTML4/XHTML1 (including the non-HTML4 &apos;), outputting them as named entities (for < and > output as &lt; and &gt;), decimal entities (for &nbsp;, output as &#160;) or UTF-8 literals – see Santizer.php for the named entity list.
Surely this will continue unaffected by activating HTML5 mode? (Otherwise, the disruption would be immense.)
However, the parser does not recognise the 1,978 entities first added with HTML5 (including 106 legacy-compatibility entities without a trailing semicolon or with variant capitalization), so the ampersand gets escaped and the named entities appear as in the wikitext.
For example: the HTML4 entity for U+00C0 (#192, À, &Agrave;) is rendered À (source:
À
) but the new HTML5-legacy-compat entities for U+003E (&gt without a semicolon, and uppercase &GT; and &GT) are escaped to render literally (as &gt, >, &GT) and the new HTML5 entity for U+0102 (#258, Ă) &Abreve; is rendered Ă.
Codepoint UTF-8 Decimal Hex Output Named
U+0022 " &#34; " &#x22; " " &quot; "
U+0027 ' &#39; ' &#x27; ' ' &apos; '
U+003C < &#60; < &#x3c; < &lt; &lt; <
U+003E > &#62; > &#x3e; > &gt; &gt; >
U+00A0   &#160;   &#xa0;   &#160; &nbsp;  
U+00C0 À &#192; À &#xc0; À À &Agrave; À
U+0102 Ă &#258; Ă &#x102; Ă Ă &Abreve; Ă
I suspect that the omission is an intentional encouragement to use UTF-8 literals in wikitext instead of more opaque encodings.
Richardguk (talk) 22:03, 7 September 2012 (UTC)Reply
I think the HTML4 entities are plenty: it's really only very common non-ASCII things like nbsp, —, ™, ©, •, † that people really care about. Particularly nbsp. -- The Anome (talk) 22:06, 10 September 2012 (UTC)Reply

mark tag[edit]

No support <mark> tag?--Shizhao (talk) 02:51, 28 September 2012 (UTC)Reply

See bugzilla:39067 and gerrit:17793. Helder 11:26, 1 October 2012 (UTC)

The output of WMF wikis is it full HTML5?[edit]

Hi,

When I look the source code of https://fr.wiktionary.org/wiki/tris-mal, I see that the tag <br /> is in the source code <br ></br>. But in the spec' of HTML5, the tag is normally just <br> [1].

Does someone has an idea of the reason? Thanks by advance, Automatik (talk) 09:48, 16 July 2013 (UTC)Reply

Both are valid HTML5. WMF just has $wgWellFormedXml set so output is also valid XML. Daniel Friesen (Dantman) (talk) 10:18, 16 July 2013 (UTC)Reply
Ok, thank you so much! Automatik (talk) 10:30, 16 July 2013 (UTC)Reply