Wikipedia talk:AutoEd

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Addition of �[edit]

In this edit, AutoEd appears to have tried to replace (A.16/15) with (A�/15), which broke the wikilink it was inside of. Any idea what caused this change to happen, and is this a fixable issue? Thanks. Aidan9382 (talk) 06:02, 17 May 2023 (UTC)[reply]

In this edit, AutoEd replaced lineage B.1.617.2 with lineage B.1a7.2 and made several other similar changes within the table 'SARS-CoV-2 corresponding nomenclatures', which broke the related wikilink in every case. This is not the first time such a thing has happened on the page. How can it be stopped? Yadsalohcin (talk) 23:44, 16 December 2023 (UTC)[reply]

Edit request (2023-12-23)[edit]

This script replaces everything that is a dot followed by what appears to be a unicode character code with the corresponding character. However, HTML entities are specified with `&#`, not dot, which I assume to be a quirk from IE. As such, I'd like to change the following lines:

// change "." to "%" when followed by valid hex .replace(/\.([0-9A-F]{2})/gi, "%$1")
+
// change "&#" to "%" when followed by valid hex .replace(/&#([0-9A-F]{2})/gi, "%$1")

Aaron Liu (talk) 17:34, 23 December 2023 (UTC)[reply]

 Done This isn't an IE quirk - at one point in time Wikimedia HTML-encoded funky characters in headings with dots, i.e Bracket#Uses_of_.5B_.5D. But the current logic is doing more harm than good it appears, so I fixed it anyway. * Pppery * it has begun... 21:15, 23 December 2023 (UTC)[reply]
. escaping is what MediaWiki used to use to do percentencoding in anchors names of headings. mediawikiwiki:Manual:$wgFragmentModeTheDJ (talkcontribs) 21:15, 23 December 2023 (UTC)[reply]

Add fullwidth back to complete[edit]

Since we don't really use interwikis that much anymore (which were the only reason these were dropped from complete, see archive 1), I think the number of false positives are small enough to just have editors utilize manual discretion, and thus the Wikipedia:AutoEd/fullwidth.js script should be added back to the complete bundle.
Also, the following regex could be useful to make it not apply to CJK interwikis, which should be the only ones to have fullwidth stuff in their titles: \[\[:?(?:ko|jp|wuu|gan|zh|zh-[a-z]+):[^\[\]\n\uE000]+\]\]
By the way, is there a process to graduate user modules to WP:AutoEd subpages? I think both curly quotes and dashes should Aaron Liu (talk) 03:22, 28 December 2023 (UTC)[reply]

 Done and I think at this point too few people care to have a standard process for maintaining this page. * Pppery * it has begun... 15:52, 28 December 2023 (UTC)[reply]
Hmm, maybe we could add these two scripts to complete? Aaron Liu (talk) 02:35, 29 December 2023 (UTC)[reply]

Add curlyfixer to basic and complete[edit]

I'd like User:Jerome Frank Disciple/curlyfixer.js to be added to the basic and complete presets. This script has an extremely low rate of error. The process for adding this would be to add importScript("User:Jerome Frank Disciple/curlyfixer.js"); (or its mw.loader.load equivalent) below the second stanza and txt = autoEdCurlyFixer(txt); before the $textbox.textSelection... line.

I'd also like to come back later when the dashes script is fixed to be compatible for inclusion in presets to add that one to complete, but not now. Aaron Liu (talk) 02:20, 14 January 2024 (UTC)[reply]

 Done * Pppery * it has begun... 15:51, 15 January 2024 (UTC)[reply]
Unsure if it's just me but AutoEd isn't working on other wikis after the addition of said script --Minorax«¦talk¦» 14:12, 16 January 2024 (UTC)[reply]
Hmm, it doesn’t feel like a good idea to use a script made for the enwiki MOS on other wikis…
@Pppery Could you replace the imports with mw.loader.load('//en.wikipedia.org/w/index.php?title= User:Jerome_Frank_Disciple/curlyfixer.js&action=raw&ctype=text/javascript');? Aaron Liu (talk) 14:47, 16 January 2024 (UTC)[reply]
I'm inclined to agree with Aaron, but anyway  Done * Pppery * it has begun... 15:50, 16 January 2024 (UTC)[reply]

Add dashes to complete[edit]

I'd like User:Ohconfucius/dashes.js to be added to the complete preset, now that it uses the same loader function and won't override everything else. This script also has quite a low rate of error, and dashes are in MOS. The process for adding this would be to add mw.loader.load('//en.wikipedia.org/w/index.php?title= User:Ohconfucius/dashes.js&action=raw&ctype=text/javascript'); below the second stanza and txt = autoEdDashes(txt); before the $textbox.textSelection... line. Aaron Liu (talk) 23:14, 19 January 2024 (UTC)[reply]

 Not done. There are many unaddressed bug reports at User_talk:Ohconfucius/dashes.js. – Jonesey95 (talk) 23:49, 19 January 2024 (UTC)[reply]

JS content type[edit]

I use SD0001's system for making user scripts load faster. This is fine for all of my other scripts, but AutoEd will not load. After some burrowing about in the loader code, I see that Wikipedia:AutoEd/complete.js has a Page content model of JavaScript, but the component JS pages have a Page content model of wikitext. Could the (13 14) component JS pages modules be set to JavaScript as well? — GhostInTheMachine talk to me 10:49, 25 January 2024 (UTC)[reply]

I’ve turned this into an edit request. Note that components are named "modules". Aaron Liu (talk) 12:07, 25 January 2024 (UTC)[reply]
Thanks — GhostInTheMachine talk to me 12:15, 25 January 2024 (UTC)[reply]
Also, it’s only basic, complete, and unicodehex that have it corrected ( because I’ve submitted unrelated edit requests for these). All 15 other pages need the correction. Aaron Liu (talk) 16:06, 25 January 2024 (UTC)[reply]
Apparently template editors can do this. (Not sure if that will work on fully-protected pages, though.) — Qwerfjkltalk 16:11, 25 January 2024 (UTC)[reply]

On Wikimedia projects this permission is granted via user groups: to sysops, interface editors and - on some projects - template editors.

So any admin would also be able to edit.
On a related note, do all these pages really need to be protected? Aaron Liu (talk) 16:19, 25 January 2024 (UTC)[reply]
Yes, they do need to be fully protected. In fact they should be locked down further to interface admins. The ability to run JavaScript on others' browsers should not be taken lightly.
I am declining this edit request as it misdiagnoses the problem - SD0001's code linked, by design, refuses to load scripts from outside of user and MediaWiki namespace so changing the content model won't do anything. * Pppery * it has begun... 16:52, 25 January 2024 (UTC)[reply]
I have separately requested that SD0001's loader code be changed to also allow scripts from the Wikipedia namespace. This is a different issue — the JavaScript pages for the modules should be typed as JavaScriptGhostInTheMachine talk to me 17:23, 25 January 2024 (UTC)[reply]
Fine.  Done * Pppery * it has begun... 20:38, 25 January 2024 (UTC)[reply]
Sorry @Pppery:, but you missed one — Wikipedia:AutoEd/templates.jsGhostInTheMachine talk to me 09:35, 26 January 2024 (UTC)[reply]
 Done That too. * Pppery * it has begun... 14:37, 26 January 2024 (UTC)[reply]
Many thanks — GhostInTheMachine talk to me 13:32, 28 January 2024 (UTC)[reply]

Don't repalce em and strong tags with wikitext[edit]

Replace

  str = str.replace(/<(B|STRONG)[ ]*>((?:[^<>]|<[a-z][^<>]*\/>|<([a-z]+)(?:| [^<>]*)>[^<>]*<\/\3>)*?)<\/\1[ ]*>/gi,  "'''$2'''");
  str = str.replace(/<(I|EM)[ ]*>((?:[^<>]|<[a-z][^<>]*\/>|<([a-z]+)(?:| [^<>]*)>[^<>]*<\/\3>)*?)<\/\1[ ]*>/gi,  "''$2''");

with

  str = str.replace(/<B[ ]*>((?:[^<>]|<[a-z][^<>]*\/>|<([a-z]+)(?:| [^<>]*)>[^<>]*<\/\3>)*?)<\/\1[ ]*>/gi,  "'''$1'''");
  str = str.replace(/<I[ ]*>((?:[^<>]|<[a-z][^<>]*\/>|<([a-z]+)(?:| [^<>]*)>[^<>]*<\/\3>)*?)<\/\1[ ]*>/gi,  "''$1''");

This stops AutoEd from replacing strong and em tags with bold/italics, as the former are quite semantically different and the latter is only visual. Aaron Liu (talk) 19:32, 25 January 2024 (UTC)[reply]

 Done * Pppery * it has begun... 20:38, 25 January 2024 (UTC)[reply]

Removes links in transcluded content using lsth[edit]

I’m not sure the extent of the behavior, but with #lsth AutoEd seems to remove links, at least to self.

I’m using this on a private wiki, but the following behavior was observed on many attempts:

on the page “Cleric”:

{{#lsth:Armor|[[Cleric]]}} changed to {{#lsth:Armor|Cleric}} and this no longer transcludes using lsth, since the page it’s transcluding links back to Cleric. Ryandward (talk) 19:22, 30 January 2024 (UTC)[reply]

Maybe it’s because section names aren’t supposed to have links in them on enwiki. I’ll see if I can reproduce and patch this
Also, thanks IP for formatting help Aaron Liu (talk) 19:29, 30 January 2024 (UTC)[reply]
My bad. I made the post on my phone and could not figure out how to fix it, so I went on my desktop where I apparently forgot to log in :) Ryandward (talk) 01:47, 31 January 2024 (UTC)[reply]
I missed the detail where it's a self link. That makes this a lot more plausible, though I still heavily recommend against including links in headings. Anyways, to remove that simply follow the instructions under the Configuration section to remove the Wikipedia:AutoEd/wikilinks.js module. Aaron Liu (talk) 02:25, 31 January 2024 (UTC)[reply]
Thank you. I wasn't sure where the behavior was coming from. I can easily implement this on my own. Ryandward (talk) 02:34, 31 January 2024 (UTC)[reply]
I know the linking in the headings is a bad idea, and I've been trying to figure out a way around it -- especially since #lsth is quite unstable to changes. Do you have any suggestions or further reading as to how to make this more compliant? Ryandward (talk) 02:46, 31 January 2024 (UTC)[reply]
More compliant, in what way? Why would you need to have a link in the heading? Aaron Liu (talk) 02:55, 31 January 2024 (UTC)[reply]