Giter VIP home page Giter VIP logo

Comments (6)

JJMC89 avatar JJMC89 commented on August 16, 2024 1

(?=((?:\n|! !|!~|\\)[ \t]*)((?:[^\\~\n]|~(?!~))+?)([ \t]*(?:\n|!~|~~|!@|__|!_|\\))) should do it and gives ['exlv-BHF~g', 'exlvBST~g-', 'dBHF~R yellow', 'dBHF~R yellow'] as new icon matches for the testcase.

from jjmc89-bot-scripts.

jc86035 avatar jc86035 commented on August 16, 2024

It might be possible simply to remove ~ from that part of the regular expression. Even with icon names starting and ending with ~, the regular expression seems to work (and in some cases the tildes would have to be separated by a space anyway to prevent signature generation).

from jjmc89-bot-scripts.

JJMC89 avatar JJMC89 commented on August 16, 2024

Taking ru:Template:Малое кольцо Московской железной дороги as a testcase, that change results in the following new regex matches (icon part only): ['~~', '~~1,2', '~~3,8', '~~4,9', '~~6,5', '~~13,8', '~~18,6', '~~20,3', '~~', '~~21,2', '~~', '~~', '~~', '~~25,5', "~~''{{ст.|Симоново}}'', ''{{ст.|Лизино}}''", '~~27,9', '~~30,2', '~~31,0', '~~33,4', '~~33,9', '~~35,0', '~~37,5', '~~37,9', 'exlv-BHF~g', '~~38,6', '~~39,3', 'exlvBST~g-', '~~', 'dBHF~R yellow', "~~''{{ст.|Октябрьские Казармы}}''", 'dBHF~R yellow', '~~44', '~~46,5', '~~', '~~48,0', '~~49,5']. Since most of those don't represent BSicons, we are left with ['exlv-BHF~g', 'exlvBST~g-', 'dBHF~R yellow', 'dBHF~R yellow'] to check if they should be replaced.

@jc86035 Please confirm this is the desired change.

from jjmc89-bot-scripts.

jc86035 avatar jc86035 commented on August 16, 2024

I think this should be fine. BSicon names can't contain two consecutive tildes anyway (due to {{Routemap}} restrictions), although it might help to filter out matches containing two consecutive tildes to prevent indirect vandalism (e.g. from the creation of [[File:BSicon ~~.svg]] as a redirect).

from jjmc89-bot-scripts.

jc86035 avatar jc86035 commented on August 16, 2024

@JJMC89 the icons are still not being replaced; e.g. w:en:Template:Duckmanton Junction. Interestingly this still happens in BS-map diagrams where the regex shouldn't affect tildes at all; e.g. w:en:Template:Dublin-Waterford railway line. I suspect this might be because the redirect list is not being downloaded due to being too long. Its length has tripled since 19 May. If this is the issue, maybe another mass deletion of unused redirects is needed; or the list could be temporarily split into three based on page ID, with …/redirects/1 (oldest redirects) being used on Monday and Thursday, and so on.

from jjmc89-bot-scripts.

JJMC89 avatar JJMC89 commented on August 16, 2024

the icons are still not being replaced

That is unrelated to the code change here. See #29 (comment).

from jjmc89-bot-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.