Juliano, I like your approach to blogging in MW, but I'm even more curious about your abbreviations tags, for example in the post about Mozilla Bookmarks to Wiki (21 July 2006). I looked at the templates and tags, but saw no extension controlling this on your Version page. Can you say how this is done? I don't like the heavy java in the ToolTips extension. Your approach is more like what I'm looking for.
CW
Hello CW Dillon,
The magic involves changing core MediaWiki code. <abbr> and <acronym> tags are blacklisted by default. You have to "unblacklist" them in Sanitizer.php, and the rest is just template magic.
In Sanitizer.php, Sanitizer::removeHTMLtags() function, add 'abbr' and 'acronym' elements to the $htmlpairs array.
Then, in the same file, in Sanitizer::setupAttributeWhitelist(), find the two "abbr" and "acronym" commented lines and replace them with:
'abbr' => $common, 'acronym' => $common,
After that, you will be allowed to use abbr and acronym tags in your pages. Like this:
<abbr title="eXtensible Markup Language">XML</abbr>
I used some template magic to make this less tedious. There are templates for each abbreviation and acronym, like {{XML}}, that expands to, for example:
{{abbr|XML|eXtensible Markup Language}}
and {{abbr}} and {{acronym}} templates that expand to, respectively:
<abbr title="{{{2}}}">{{{1}}}</abbr>
<acronym title="{{{2}}}">{{{1}}}</acronym>
Regards, Juliano.
CW Dillon wrote:
Juliano, I like your approach to blogging in MW, but I'm even more curious about your abbreviations tags, for example in the post about Mozilla Bookmarks to Wiki (21 July 2006). I looked at the templates and tags, but saw no extension controlling this on your Version page. Can you say how this is done? I don't like the heavy java in the ToolTips extension. Your approach is more like what I'm looking for.
Alternatively (without modifying core code), you could write parser-tag extensions that implement <abbr> and <acronym>.
DanB
-----Original Message-----
The magic involves changing core MediaWiki code. <abbr> and <acronym> tags are blacklisted by default. You have to "unblacklist" them in Sanitizer.php, and the rest is just template magic.
Daniel Barrett wrote:
Alternatively (without modifying core code), you could write parser-tag extensions that implement <abbr> and <acronym>.
Yes, possible, but I wonder if the added bloat justifies. Every extension installed adds a small performance impact upon every page load, because extensions are included from LocalSettings.php.
In this specific case, I think that adding a configuration variable to MediaWiki would make more sense: it is a very simple change that would have almost no impact.
That is discussed in bug 671: https://bugzilla.wikimedia.org/show_bug.cgi?id=671
mediawiki-l@lists.wikimedia.org