MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
mw. | // Only run for MinervaNeue | ||
if ( mw.config.get('skin') === 'minerva' ) { | |||
mw.hook('wikipage.content').add(function($content) { | |||
// Remove "Category:" prefix from all links inside content | |||
if (link. | $content.find('a').each(function() { | ||
link. | var $link = $(this); | ||
if ( $link.attr('href') && $link.attr('href').includes('/Category:') ) { | |||
$link.text($link.text().replace(/^Category:/, '')); | |||
} | } | ||
}); | }); | ||
}); | }); | ||
Latest revision as of 14:24, 9 October 2025
// Only run for MinervaNeue
if ( mw.config.get('skin') === 'minerva' ) {
mw.hook('wikipage.content').add(function($content) {
// Remove "Category:" prefix from all links inside content
$content.find('a').each(function() {
var $link = $(this);
if ( $link.attr('href') && $link.attr('href').includes('/Category:') ) {
$link.text($link.text().replace(/^Category:/, ''));
}
});
});