Help talk:HTML in wikitext
- 1 How to embed link to file:// resource
- 2 removeHTMLtags function in wrong place
- 3 Bad practice
- 4 Means to enable <a> tags
- 5 <pre> stops wikitext parsing?
- 6 Need for a manual anchor
- 7 <rss></rss> documentation?
- 8 Avoid closing tags in templates
- 9 span
- 10 tr and td tags not rendering
- 11 Messed up Coding Due to $wgUseTidy
- 12 WikiProject Microformats
- 13 Opening links in a new window
- 14 <pre> wrapping
- 15 Request for revision of Div/HTML comment sections
- 16 Please give me a list of accepted wikipedia span and div attributes
- 17 Request for <colgroup> and <col> tags
- 18 embed badges, etc.
- 19 Time to support HTML5 inline MathML and SVG?
- 20 This doc in mediawiki.org
We're using an internal deployment of MediaWiki and we've had many occasions where we'd like to provide a link to an internal file server - either a single, large file (that's too big and changes too often to simply upload to the MediaWiki server), or a folder with multiple documents. Migrating this content to SharePoint may happen in the longer term, but for the forseeable future we need to support the existing repositories.
We've tried to embed links to these shares using a number of different format variations, none of which work the way file:// links work in native HTML pages:
- File://server/proj/ A file:// type link
- File:////server/proj/ another file type link
- \\server\proj What about this link type?
Each time, these either create *no* link or they create a link that gets pre-pended with a URL stub referring to the current server: http://wiki.company.com/?title=
This ends generating a query for a non-existent page on the Wiki server (i.e. the browser tries to retrieve a page like http://wiki.company.com/?title=File://server/proj/_A_file://_type_link&action=edit, rather than instantiating the protocol handler to call up a Windows Explorer instance.
Q: Does anyone know the "secret" way to make a working link to a file:// resource?--Poseidon 01:18, 18 March 2008 (UTC)
- No definite answer, only an idea that worked with our local wiki software: Would defining a special interwiki link like "localfile" which expands to "file://server/" help in MediaWiki as well? Vigilius 22:23, 14 April 2008 (UTC)
- My solution for IE and Firefox was to add three additional / after file://, leading to something like [file://///server/proj]
Additionally, as Firefox blocks local file links, I had to add a file users.js to my Firefox Profiles .default directory with the following content:
user_pref("capability.policy.policynames", "localfilelinks"); user_pref("capability.policy.localfilelinks.sites", "http://intranet"); user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
- Werner--184.108.40.206 09:06, 4 March 2010 (UTC)
In 1.4rc1, the removeHTMLtags function is located in Parser.php, not OutputPage.php... This should be fixed in the documentation on this page.
how can i allow the <a> and <img> tags??
- In 1.5 this function has been moved to Sanitizer.php. It would be nice to have the list of acceptable tags be configurable from LocalSettings.php. I am working on a site where I can trust some of the other tags to be (relatively) safe and very useful. --Cuthbert 07:25, 14 November 2005 (UTC)
This page encourages bad practice (e.g. setting colour without setting background colour); and says nothing about accessibility in general. 220.127.116.11 12:23, 23 November 2005 (UTC)
We have a need to enable <a> to create tags like:
<a href='LaunchMenu.exe MENUID, 145’ > text to link </a>
These enable links to interact with an application.
mcl 10:36, 20 September 2006 (UTC)
Updated 2011-06-08 by an anonymous user . . . Also - the ability to link to lower sections in a large wiki page is sorely missed.
<pre> stops wikitext parsing?
<pre><b>[[Help:HTML in wikitext]]</b></pre> produces
<b>[[Help:HTML in wikitext]]</b>.
Surely that's not correct? The wikicode should be parsed unless <nowiki> is added. Why this "feature"? Adding a space to the beginning of every line in a block of code can be a significant nuisance, but if the code contains any markup at all (such as if you want to highlight a portion of it), <pre> is unusable. Simetrical 03:08, 1 February 2006 (UTC)
It's better with '''...''' and to link Main Page simply without <pre>...</pre>, better use a space at the beginning of each line... Hégésippe | ±Θ± 03:30, 1 February 2006 (UTC)
- I know that works, but it can be a nuisance when you're talking a big block of code. Simetrical 03:32, 1 February 2006 (UTC)
Need for a manual anchor
I just came up with a case where I must use anchor (<a>), in order for the text to behave correctly. This is not about presentation, this is about structure.
The page itself is is in French (here), but I'll give an English example
- This is on Wiktionary, which has two practices, which are technically exclusive without resorting to true HTML.
- any instance of the defined word is in bold
- a proverb/maxim/saying… will be hyperlinked to the page related to it
- Now here's the problem.
- The word is theme (translating from your native language to a foreign tongue)
- The expression is, roughly translated to be skillful in theme. Theme being considered has difficult and delicate, to be skillful in such an exercise means to be very good.
- And now for the coding
- Idea — italic -- anchor -- expression -- bold -- word -- /bold -- /anchor -- italic
- tags —<q><a>to be skillful in <strong>theme</strong></a>/<q>
- expected result — to be skillful in theme
Problem is it is not possible to insert bold in a link. But here, it is required by the formatting guideline. For now on, I just made an exception and left the word without particular weighting.
- A piped link works fine:
- Patrick 08:27, 11 March 2006 (UTC)
I found <rss> </rss> used for newsfeed transclusion here: http://www.moreperfect.org/wiki/index.php?title=NewsFeeds
Where is this documented?
- --jwalling 22:51, 13 July 2006 (UTC)
In MW 1.7.1, is there a way to avoid automatically closing some tags, or even all tags on some pages, when a page is included? I'm trying to do something similar to w:Portal:Box-header and w:Portal:Box-footer, where the header template opens a div and the footer template closes it, but Sanitizer.php keeps closing all the open tags in the header and converting the "unopened" tags in the footer to HTML entities, even when the templates are transcluded, not accessed directly. Is there a way to fix this in MW 1.7.1, or do I need to upgrade to 1.8? It, obviously, does not happen on the WikiMedia sites running 1.8. --Jimmy 07:35, 25 July 2006 (UTC)
- I have the same problem for exactly the same use on my own wiki using Mediawiki 1.8.2 and i'm not able to find an answer anywhere (didn't try irc for now) -- Lenaic 08:06, 29 November 2006 (UTC)
why isn't span listed as permitted HTML?? JanCK 19:29, 15 August 2006 (UTC)
- in current version it is Vigilius 22:25, 14 April 2008 (UTC)
i am running a non-modified 1.7.1 installation of mediawiki, and i'm using #if in a template for a table. i've run into a problem where the <tr> and <td> tags get misinterpreted in a table
for example, if i put this in the template
a page loading the template would display this on screen (if birth is given a value of January 1, 2002), instead of rendering a table row and 2 cells as intended
<tr valign="top"><td>Birthdate:</td><td>January 1, 2002</td></tr> (in bold text)
viewing the html source of the page would reveal that mediawiki rendered this html
& lt;tr valign="top"& gt;& lt;td& gt;<b>Birthdate:</b>& lt;/td& gt;& lt;td& gt;January 1, 2002& lt;/td& gt;& lt;/tr& gt; (i inserted spaces between & and lt; and gt; so you can see them)
the b tag was rendered, yet tr and td were not. all this was inside a table so i'm confused as to why it's happening. also if i put a linebreak anywhere in the template code, a p tag is rendered. i think the sanitizer might be doing something but i'm not sure. i need a wiki expert to help me out!
if this is not the right place to ask for help, please let me know where i could go. any help is appreciated. my email is my user name at yahoo .com--Hexvoodoo 07:33, 29 September 2006 (UTC)
- See: Talk:ParserFunctions#Solution_to_Tables_Problems for a solution that works, but can break other things, see the next question below. --Dr DBW 23:58, 11 December 2006 (UTC)
Messed up Coding Due to $wgUseTidy
Due to some problems with the handling of html coding by ParserFunctions, in particular with tables, I enabled $wgUseTidy. This solved the problem I had with the correct rendering of the tables but and it has broken some of the HTML generated associated with displaying images. It effects every single image that is displayed in the wiki. What appears to be happening is that some of the opening and closing tags of the code is generated as & gt; or & lt;. Which then means that things fail, get funny bits of code appearing on the page etc. The code was working fine before enabling $wgUseTidy.
I have also posted this on MediaWiki at Manual talk:$wgUseTidy The original issue I had is outlined here: Talk:ParserFunctions#Further_HTML_.28Tables.29_Problems along with the solution: Talk:ParserFunctions#Solution_to_Tables_Problems. --Dr DBW 23:58, 11 December 2006 (UTC)
Anyone interested in microformats (or metadata in general) and the deployment of microformats on Wikipedia, might like to be aware of, or even join, WikiProject Microformats. AndyMabbett 09:04, 30 March 2007 (UTC)
Since I can't use <a> tags, how can I force links within my wikitext to open in a new window?
Is it worth mentioning (somewhere) the code for getting <pre> tag to word wrap?
Request for revision of Div/HTML comment sections
I could follow the article as of 2008-04-15 well up to the "<div> Rules". However, starting with "Example:" it completely fails for me. I do not understand the relationship of the examples to the rules. Even worse, nothing in the section on "HTML comment" makes sense to me. I am fairly new to Wikipedia, but so I may be a good tester. I appreciate if someone who can grasp the intended purpose of these sections can help revise them. Vigilius 22:19, 14 April 2008 (UTC)
- Note the quotations marks. Everything between the first pair is the wikitext, and between the second pair is the result.--Patrick (talk) 22:33, 14 April 2008 (UTC)
Please give me a list of accepted wikipedia span and div attributes
Since mediawiki's support for tables is basic, HTML is needed for more advanced tables. thead and tfoot isn't really needed often, but the colgroup and col tags are essential tools for formatting columns. These should be put into the whitelist or however it works in mediawiki. Miqademus 18.104.22.168 13:32, 23 July 2009 (UTC)
embed badges, etc.
Perhaps add examples of best ways to embed complete badges etc. e.g., http://www.facebook.com/badges/ , without installing extensions. Probably via setting several $wg... variables. Jidanni 05:42, 6 January 2012 (UTC)
Time to support HTML5 inline MathML and SVG?
Is it time yet to add support for math and svg elements inline? Then they could be pasted directly into the wiki as part of an article instead of posted as a separate file for every single item. It seems like a more organized approach to me.
This doc in mediawiki.org
Is there a page equivalent to this in mediawiki.org? I got here following a link at mw:HTML restriction. "What HTML can I use in MediaWiki pages is a frequent question coming also from non/Wikimedia editors.--Qgil (talk) 18:03, 27 February 2014 (UTC)