User:Bot doubleredirects/Gadget-DoubleRedirectFixer.js: Difference between revisions

No edit summary
No edit summary
Line 55: Line 55:
     */
     */
     const extractAnchorFromContent = (content) => {
     const extractAnchorFromContent = (content) => {
         const match = content.match(/#הפניה\s*\[\[[^\]]+?(?:#(.+?))?\]\]/);
         const match = content.match(/#REDIRECT\s*\[\[[^\]]+?(?:#(.+?))?\]\]/);
         return match?.[1] ? "#" + match[1] : "";
         return match?.[1] ? "#" + match[1] : "";
     };
     };
Line 104: Line 104:
                 // **השורות עם "tags" הוסרו לחלוטין כאן.**
                 // **השורות עם "tags" הוסרו לחלוטין כאן.**
                 title: title,
                 title: title,
                 text: "#הפניה [[" + target + "]]",
                 text: "#REDIRECT [[" + target + "]]",
                 summary: "בוט: מתקן הפניה כפולה ל- [[" + target + "]]",
                 summary: "בוט: מתקן הפניה כפולה ל- [[" + target + "]]",
             });
             });