Comments (6)
(?=((?:\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.
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.
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.
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.
@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.
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)
- [bsicons_replacer] Noinclude tags can prevent proper parsing
- [bsicons_replacer] Icon names need to be trimmed? HOT 3
- Rewrite bsicons_replacer to use GlobalUsage
- [bsicons_replacer] Convert percent encodings and HTML character entities to Unicode characters HOT 3
- Search for date should be for section header and not just date HOT 1
- [bsicons_replacer] Bot should edit cswiki Template:Železniční trať HOT 2
- [bsicons_replacer] [Request] Find/replace for bsq/bso templates HOT 1
- [bsicons_replacer] Edit unnamed parameters in Routemap templates HOT 1
- [bsicons_replacer] Bad replacement if ROUTEMAP_BSICON matches ^ or $
- [bsicons_replacer] A page containing {{!}} can prevent replacement HOT 1
- [bsicons_replacer] HTML comments in {{Routemap}} can prevent replacement HOT 2
- Title preceding <includeonly> is not recognized HOT 1
- [bsicons_replacer] Replace file syntax
- No redirects are being replaced HOT 3
- File names in galleries are not replaced HOT 2
- [Request] CSD-G6 unused BSicon redirects HOT 2
- [request] Allow BSicon replacement without a config HOT 3
- [magic_links_replacer] Text in nowiki tags is not protected during replacement HOT 2
- cfdw: erroneous redirect deletion when the redirect content creates a backlink to the category HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jjmc89-bot-scripts.