Wikipedia talk:AutoEd

(Redirected from Wikipedia talk:AutoEd/unicodehex.js)
Latest comment: 10 days ago by Aaron Liu in topic Purpose

Curlyfixer breaking images

edit

Please see this edit for an example. 81567518W (talk) 13:19, 26 November 2025 (UTC)Reply

I think the proper solution is to rename the file so it doesn't contain curly braces. I've filed a rename request. Aaron Liu (talk) 02:49, 12 December 2025 (UTC)Reply

Customization

edit

The instructions for customization state:

To change the variables, just copy the following into your monobook.js page, where you should also have the "basic" preset imported ...

My monobook.js doesn't exist, so I dont have any "basic" preset imported. Where do I get this, and how do I import it?

Thanks --Lexiconaut (talk) 05:39, 22 December 2025 (UTC)Reply

The page you want to edit is User:Lexiconaut/common.js. See User:Jonesey95/vector-2022.js, where I import some AutoEd scripts. I don't use the basic.js or complete.js scripts, preferring to run only code that I have written, but if you remove the // comment characters and paste the basic.js line into your common.js, you might be able to get things to work. – Jonesey95 (talk) 00:46, 23 December 2025 (UTC)Reply
Thank you! That worked. --Lexiconaut (talk) 01:08, 23 December 2025 (UTC)Reply
edit

It breaks legitimate constructions like e.g.

  • [[Carbon|C]][[Hydrogen|H]] (CH₄)
  • benzo[''e''][1,4]diazepine (benzo[e][1,4]diazepine)
  • [Co(NH₃)₆][Cr(CN)₆] (both-ion coordination complex salts)

by adding a space between ] and [.

(See e.g. my revert 1340002663, btw with edit link in summary.)

Rude str = str.replace(/\]\[/g, "] [") in links.js is to blame.

--Mykhal (talk) 16:15, 23 February 2026 (UTC)Reply

Things like the individual elements in CH4 probably shouldn't be linked, but you're right that the script breaks "(+)-sparteine surrogate"
I guess we might want to remove that line. I'm not sure if I should file an edit request though because I'm unsure how often that line is used. Aaron Liu (talk) 16:56, 23 February 2026 (UTC)Reply
This was only one of many examples, see more my today's edits. But I would't entirely exclude a possibility that it's fixing some much more common real issue. —Mykhal (talk) 17:38, 23 February 2026 (UTC)Reply
Yeah, I did mean examples of any real issue it's fixing. Aaron Liu (talk) 02:11, 24 February 2026 (UTC)Reply

Where it?

edit

After an afternoon editing stoppage, my auto ed tab disappeared. Any suggestions? Regards Keith-264 (talk) 21:09, 5 March 2026 (UTC)Reply

All user scripts have been temporarily disabled due to a misstep during security testing. – Jonesey95 (talk) 22:03, 5 March 2026 (UTC)Reply
Ah, thanks Keith-264 (talk) 22:38, 5 March 2026 (UTC)Reply

bug: Doesn't respect nowiki tag

edit

On the article Web design, I recently fixed up some poorly place <nowiki> tags and discovered that this script isn't respecting those tags. As of writing, there's an instance of the following code snippet which this script attempts to transform into a wikitext table: <code><nowiki><table></nowiki></code>. Newtbytes (talk) 01:17, 20 April 2026 (UTC)Reply

I think this case is rare enough to not matter. Aaron Liu (talk) 14:39, 20 April 2026 (UTC)Reply
I would disagree; clearly it's common enough that I encountered it. This bug would likely affect any article that has HTML example code, which is pretty significant. Newtbytes (talk) 18:01, 20 April 2026 (UTC)Reply
I imagine that this bug isn't in this specific script (referring to Wikipedia:AutoEd/htmltowikitext.js) since ignoring nowiki tags is probably something that any AutoEd module that transforms wikitext should respect. Perhaps the fix is ensuring that AutoEd modules ignore content in nowiki tags. Newtbytes (talk) 18:02, 20 April 2026 (UTC)Reply
Ignoring nowiki everywhere is hard for multiple reasons, the one with the easiest explanation being that AutoEd doesn't parse Wikitext and instead is mostly regular expressions (advanced find-and-replace).
The <table> case mentioned only happens on two articles and doesn't seem to appear anywhere else outside of discussion pages. I cannot think of a way to fix this case just in htmltowikitext without using way too much performance resources since this change would not produce a benefit anywhere it is run other than those two articles (AutoEd usually is not run on discussion pages). Aaron Liu (talk) 22:53, 20 April 2026 (UTC)Reply
Now that I think about it, I guess replacing all nowiki content first with some garbage string and then replacing the garbage string at the end could work (ignoring the modular limitations I've mentioned above so I'm assuming this approach is just something we're considering for the htmltowikitext module). I still need to see some more examples of the htmltowiki replacing stuff in nowiki tags to justify implementing this, though. Aaron Liu (talk) 22:58, 20 April 2026 (UTC)Reply
I found a better search query for the <table> example: . There are actually four instances where AutoEd would erroneously replace tables that should not be wikitext tables. Table isn't the only tag that theoretically could be affected, for example <b>, <i>, <br>, and others, though search is a bit slower for those and times out so I can't find any specific instances. Newtbytes (talk) 23:50, 20 April 2026 (UTC)Reply
The biggest reason, requiring a lot of explanation, deals with how AutoEd is modular. You can yourself modify how everything is applied. There's no base module of things to do before or after all the other modules, so the only way to break the 15-year–long assumption that AutoEd will not itself prevent you from handling nowiki tags. Other editors might have written their own AutoEd scripts to do things onto nowiki tags. Aaron Liu (talk) 23:01, 20 April 2026 (UTC)Reply
Perhaps then it could be handled in the default main function if that is such a thing? Or it could be handled at the point each module is called, if that's possible. I don't know anything about how AutoEd is structured architecturally so my understanding of how it could work is probably pretty flawed. Newtbytes (talk) 23:53, 20 April 2026 (UTC)Reply

"VERY easy to install" - yeah, right

edit

After a lot of experimentation to try to get the thing to work, it appears to me that it doesn't work at all when User:Ohconfucius/dashes.js is installed. No mention of this on the page though. Am I wrong? Nurg (talk) 23:06, 24 May 2026 (UTC)Reply

This is because Ohconfucius/dashes is an AutoEd module that loads AutoEd by itself if AutoEd is not installed. It's easy to install if you don't have such wizardry; if you do, it's a bit harder, but not too hard.
A full guide is at Wikipedia:AutoEd/Customization but for just the task at hand:
  1. Go to the code of the preset you want to base off of (in this case, Wikipedia:AutoEd/complete.js). We'll call it File 1.
  2. Go to the module you'd like to mix in (in this case, User:Ohconfucius/dashes.js). We'll call it File 2. Find the name of the AutoEd module function, which should be prefixed with function autoEd (in this case, autoEdDashes).
  3. In File 1, at the bottom of autoEdFunctions(), right before saving (so usually the second-to-last line), transform the text with the function name you found (in this case, add above line 39 the line txt = autoEdDashes(txt);).
  4. Make sure you import File 2 somewhere before autoEdFunctions() in File 1.
  5. Add the result to your common.js.
For reference, here's my customization, which is the Complete preset + Dashes + User:Aaron Liu/AutowIll.js and a small snippet to make AutoEd not do anything if it doesn't give you any changes:
var AutoEd_baseurl = 'https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedia:AutoEd/';

//Import individual modules for use
mw.loader.load(AutoEd_baseurl + 'unicodify.js'); // autoEdUnicodify() converts HTML entities to WikiText
mw.loader.load(AutoEd_baseurl + 'isbn.js'); // autoEdISBN() fixes ISBN syntax so that WikiMagic can work
mw.loader.load(AutoEd_baseurl + 'whitespace.js'); // autoEdWhitespace() cleans up whitespace
mw.loader.load(AutoEd_baseurl + 'wikilinks.js'); // autoEdWikilinks() simplifies and shortens wikilinks where appropriate
mw.loader.load(AutoEd_baseurl + 'htmltowikitext.js'); // autoEdHTMLtoWikitext() converts HTML to wikitext
mw.loader.load(AutoEd_baseurl + 'headlines.js'); // autoEdHeadlines() fixes common headline errors and renames some headers
mw.loader.load(AutoEd_baseurl + 'unicodecontrolchars.js'); // autoEdUnicodeControlChars() converts HTML to wikitext
mw.loader.load(AutoEd_baseurl + 'unicodehex.js'); // autoEdUnicodeHex() converts hex encoded characters to unicode
mw.loader.load(AutoEd_baseurl + 'templates.js'); // autoEdTemplates() cleans up templates
mw.loader.load(AutoEd_baseurl + 'tablestowikitext.js'); // autoEdTablestoWikitext() replaces HTML tables with wikitables
mw.loader.load(AutoEd_baseurl + 'extrabreaks.js'); // autoEdExtraBreaks() removes extra BR tags
mw.loader.load(AutoEd_baseurl + 'links.js'); // autoEdLinks() cleans up common link errors
mw.loader.load(AutoEd_baseurl + 'fullwidth.js');
mw.loader.load(AutoEd_baseurl + 'curlyfixer.js');
importScript('User:Ohconfucius/dashes.js'); // Backlink: [[User:Ohconfucius/dashes.js]]
importScript('User:Aaron Liu/AutowIll.js'); // Backlink: [[User:Aaron Liu/AutowIll.js]]
//importScript('User:Aaron Liu/AliasPam.js'); // Backlink: [[User:Aaron Liu/AliasPam.js]]
//importScript('User:Aaron Liu/NoPiper.js'); // Backlink: [[User:Aaron Liu/NoPiper.js]]

function autoEdFunctions() { //Activates individual modules when "auto ed" tab is clicked
    var $textbox = $( '#wpTextbox1' );
    var txt = $textbox.textSelection('getContents');
    txt = autoEdUnicodify(txt);
    txt = autoEdISBN(txt);
    txt = autoEdWhitespace(txt);
    txt = autoEdUnicodeHex(txt);
    txt = autoEdWikilinks(txt);
    txt = autoEdHTMLtoWikitext(txt);
    txt = autoEdHeadlines(txt);
    txt = autoEdUnicodeControlChars(txt);
    txt = autoEdTemplates(txt);
    txt = autoEdTablestoWikitext(txt);
    txt = autoEdExtraBreaks(txt);
    txt = autoEdLinks(txt);
    txt = autoEdDashes(txt);
    txt = autoEdFullwidth(txt);
    txt = autoEdCurlyFixer(txt);
    txt = autoEdwIll(txt);
    if(txt===$textbox.textSelection('getContents')){ autoEdTag = ""; mw.notify("No changes required!"); }
    else $textbox.textSelection('setContents', txt);
}
In solidarity, Aaron Liu (talk) 00:21, 25 May 2026 (UTC)Reply
Thank you. I have endeavoured to follow the instructions. "auto ed" now appears on the menu. And the 'dashes' function works. I'm trying to verify whether any of the other functions work. It looks to me that this section of a random article, Bitter in the Mouth#Linda Hammerick, contains curly quotation marks, but AutoEd is not changing them. Am I misunderstanding something, or do I maybe not have the script set up right? Thanks. Nurg (talk) 02:07, 25 May 2026 (UTC)Reply
My apologies. You very accurately followed my instructions, but it's been a long time since I've customized it, so I forgot that you need to mw.loader.load(AutoEd_baseurl + 'core.js'); //Imports the "framework" script needed to make this function before you load any script that checks whether AutoEd is loaded any replaces your autoEdFunctions with its own. So you would move Line 57 anywhere before Line 33. In solidarity, Aaron Liu (talk) 02:47, 25 May 2026 (UTC)Reply

Purpose

edit

When using auto ed I don't see any changes. Also, the documentation is vague about the purpose of AutoEd. What is it for? Thanks! Robloxguest3 (talk) 20:41, 26 May 2026 (UTC)Reply

You don't see the changes in Special:Diff/1356282062? The most noticeable one is MOS:Ellipsis compliance.
AutoEd just runs any modules you tell it to run. What it does depends on what modules/module preset you use. Wikipedia:AutoEd#Presets describes each of them and the table below tells you which modules are bundled into which presets. In solidarity, Aaron Liu (talk) 02:18, 27 May 2026 (UTC)Reply