MediaWiki:Common.js: Difference between revisions

From WikiFictionAI
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 7: Line 7:
         var content = $(this).html();
         var content = $(this).html();


         // Remove any {{#seo: ... }} tags
         // Remove any {{#seo: ... }} tags, including multi-line SEO tags
         content = content.replace(/{{#seo:[^}]*}}/g, '');
         content = content.replace(/{{#seo:[\s\S]*?}}/g, '');


         // Update the HTML of the search result with the cleaned content
         // Update the HTML of the search result with the cleaned content

Revision as of 03:49, 23 October 2024

/* Any JavaScript here will be loaded for all users on every page load. */

$(document).ready(function() {
    // Target all search result containers
    $('.searchresult').each(function() {
        // Get the current content of the search result
        var content = $(this).html();

        // Remove any {{#seo: ... }} tags, including multi-line SEO tags
        content = content.replace(/{{#seo:[\s\S]*?}}/g, '');

        // Update the HTML of the search result with the cleaned content
        $(this).html(content);
    });
});