Wikipedia talk:WikiProject User scripts/Scripts/Formatter

message: Can we add a description of what this scipt does to the main page? It may be a good idea for those using it to have similar edit summary advertising this script, like format.-- Piotr Konieczny aka Prokonsul Piotrus  talk  22:34, 25 July 2006 (UTC)
replies: text: yes, that's a good idea. thanks Martin 08:26, 26 July 2006 (UTC)
replies: text: I hope we do so, then - I am not familar enough with specific of what this script does to write a description.-- Piotr Konieczny aka Prokonsul Piotrus | talk  19:51, 31 July 2006 (UTC)

text: Ahem. I've added a doc page at Wikipedia:WikiProject_User_scripts/Scripts/Formatter/doc and transcluded it at the start of the page, in a similar manner to the way template documentation works. This will let us keep discussion away from the documentation, while making the doc available. Hope it's useful like this! ― GrimRevenant 03:52, 22 February 2007 (UTC)
thread_title: Documentation

message: I keep noticing a problem with this script: when there is a string enclosed in single brackets, like [foo], Formatter assumes from the lack of http: that it is supposed to be an internal link, and doubles the brackets. But http:// is not the only kind of resource; ftp links are valid as well as irc: or mail: links. In addition, even if there is a quote and one inserts an eluicidating comment like this: [they really meant this], the brackets will be doubled regardless. There doesn't seem to be an easy way to make that regexp smart enough to deal with all these cases, so perhaps it should just be removed. --Gwern  (contribs) 16:25, 20 October 2006 (UTC)
replies: text: Agreed. Usualy a single bracket is intentional; what the formater should fix is a single bracket/two bracket error (when one bracket is missing from an ilink). -- Piotr Konieczny aka Prokonsul Piotrus | talk  21:26, 5 December 2006 (UTC)
thread_title:  Problem with single brackets being wrongly doubled 

message: Other things to easily fix with the script: if the article has level 1 headings (=heading=), the formatter should add '=' to each heading. A slightly more complex: if a new user does not know how to make headings, they often create bolded text in a line, thus the formatter should convert lines containing only bold text into headings. Last but not least, another common newbie mistake is to start paragraphs without an extra line wiki needs; thus if the formatter could detect such 'unwikified' paras and instert an extra line, it would be another useful feature.-- Piotr Konieczny aka Prokonsul Piotrus | talk  21:26, 5 December 2006 (UTC)
thread_title:  Fix level 1 headings 

message: Did Ilmari's recent change break Formatter (and one's monobook.js in general) for anyone else? --Gwern  (contribs) 19:45 14 January 2007 (GMT)
:Yes, and for obvious reasons too.  Sorry for the inconvenience.  —Ilmari Karonen (talk) 21:13, 14 January 2007 (UTC)
thread_title:  Recent change broken? 

message: The adding of single to [single] is taken out until we can come up with a "smart" version that will know what to and what not to double bracket. Regards, -- Darkest Hour 17:06, 26 March 2007 (UTC)
thread_title: Done

message: :Note for clarity: User:Gerbrant copied this section from their talk page —GrimRevenant 09:43, 18 May 2007 (UTC)
replies: text: Hm. My own formatter (while far from perfect) doesn't seem to cause quite as much mess. I'll take this to the wikiproject to ask whether this problem still exists and where people will have some familiarity with the code-base. Shinobu 19:52, 15 May 2007 (UTC)

text: Note: I'd fix it myself, but lately RL keeps me kind of busy. Shinobu 19:54, 15 May 2007 (UTC)
replies: text: First: is this being caused by Formatter or by a search & replace tool? Your comment isn't quite clear to me. Second: seems like over-enthusiastic conversion of numerical codes to characters without checking that they're actually codes first (i.e. escaped by &;). I'll take a look and see what I can come up with. —GrimRevenant 07:45, 18 May 2007 (UTC)
replies: text: While I realise this is some time later, I've run the formatter on the exact versions of both pages you reported problems with, and I can't duplicate any of these issues. If you hit this kind of issue, it can be worthwhile doing a force refresh (Ctrl+F5 in most browsers) to make sure you're using the latest version of any scripts you're using, before you cry "bug". Cheers. —GrimRevenant 07:58, 18 May 2007 (UTC)

text: Just checked the post dates against the edit history and realised that you had copied this here from your talk page. While there's nothing wrong with that, it would be better to have included some sort of notice, because it appears User:Darkest Hour's problem was with a different tool. —GrimRevenant 09:43, 18 May 2007 (UTC)

text: Actually, no. Darkest Hour used the Wikiproject Formatter, not my one, as you can see by looking at his edit summaries. So that's why I brought the issue here, because this is (was?) a bug in the formatter here, not in mine. And because I thought you would be more familiar with the code base than I am (after all I only use mine), I thought you could fix the problem (if any) faster than I could. Shinobu 14:55, 29 May 2007 (UTC)
replies: text: From Darkest Hour's original post on your talk page (emphasis added): "Now I did use the formatter (diff) but the search and replace is what did this mess. Please fix thu bug." FWIW, I ran this formatter on the exact same page revisions Darkest Hour had problems with, and it worked flawlessly. I suspect we won't get to the bottom of this without more input from the original poster, especially regarding what exactly was searched and replaced... it's very easy to break something with a regex tool if it's used incorrectly, which I suspect may have been the case. Cheers. —GrimRevenant 04:36, 30 May 2007 (UTC)

text: @it's very easy to break something with a regex tool if it's used incorrectly: True. By the way, the only regex related tool I can find in his monobook.js is wikEd. And there is of course the possibility that he was using an old verions of any of these tools; in other words that the bug has already been fixed but that his cache needs purging. Let's wait for more details. Cheers, Shinobu 01:41, 4 June 2007 (UTC)
thread_title:  Bug 

message: diff —The preceding unsigned comment was added by Darkest Hour (talk • contribs) 21:52, 7 March 2007 (UTC)
replies: text: Hm. My own formatter (while far from perfect) doesn't seem to cause quite as much mess. I'll take this to the wikiproject to ask whether this problem still exists and where people will have some familiarity with the code-base. Shinobu 19:52, 15 May 2007 (UTC)

text: Note: I'd fix it myself, but lately RL keeps me kind of busy. Shinobu 19:54, 15 May 2007 (UTC)
replies: text: First: is this being caused by Formatter or by a search & replace tool? Your comment isn't quite clear to me. Second: seems like over-enthusiastic conversion of numerical codes to characters without checking that they're actually codes first (i.e. escaped by &;). I'll take a look and see what I can come up with. —GrimRevenant 07:45, 18 May 2007 (UTC)
replies: text: While I realise this is some time later, I've run the formatter on the exact versions of both pages you reported problems with, and I can't duplicate any of these issues. If you hit this kind of issue, it can be worthwhile doing a force refresh (Ctrl+F5 in most browsers) to make sure you're using the latest version of any scripts you're using, before you cry "bug". Cheers. —GrimRevenant 07:58, 18 May 2007 (UTC)

text: Just checked the post dates against the edit history and realised that you had copied this here from your talk page. While there's nothing wrong with that, it would be better to have included some sort of notice, because it appears User:Darkest Hour's problem was with a different tool. —GrimRevenant 09:43, 18 May 2007 (UTC)

text: Actually, no. Darkest Hour used the Wikiproject Formatter, not my one, as you can see by looking at his edit summaries. So that's why I brought the issue here, because this is (was?) a bug in the formatter here, not in mine. And because I thought you would be more familiar with the code base than I am (after all I only use mine), I thought you could fix the problem (if any) faster than I could. Shinobu 14:55, 29 May 2007 (UTC)
replies: text: From Darkest Hour's original post on your talk page (emphasis added): "Now I did use the formatter (diff) but the search and replace is what did this mess. Please fix thu bug." FWIW, I ran this formatter on the exact same page revisions Darkest Hour had problems with, and it worked flawlessly. I suspect we won't get to the bottom of this without more input from the original poster, especially regarding what exactly was searched and replaced... it's very easy to break something with a regex tool if it's used incorrectly, which I suspect may have been the case. Cheers. —GrimRevenant 04:36, 30 May 2007 (UTC)

text: @it's very easy to break something with a regex tool if it's used incorrectly: True. By the way, the only regex related tool I can find in his monobook.js is wikEd. And there is of course the possibility that he was using an old verions of any of these tools; in other words that the bug has already been fixed but that his cache needs purging. Let's wait for more details. Cheers, Shinobu 01:41, 4 June 2007 (UTC)
thread_title: another example

message: I'm thinking about the location of the tab. Currently, it goes just before the edit tab, which seems strange. Perhaps it should go after the edit tab (and the "+" tab, if there is one)? One could do this by changing the getElementById statement near the end. Anyone else think this should be moved? — Tuvok[T@lk/Improve me] 21:28, 29 May 2007 (UTC)
thread_title:  Tab location 

message: It's a minor issue, but I just wanted to point out that this script removes the extra blank line between the stub template and the rest of the content. According to this, there should be two blank lines. I have no opinion which should be practiced (one or two blank lines), however this script and the guide should agree. -Rocket000 22:01, 2 September 2007 (UTC)
replies: text: I generally remove superfluous newlines in all cases. But in the case of stubs the whole issue is pretty much moot, since a stub templates is by its nature a temporary notice. Shinobu 05:02, 4 November 2007 (UTC)
thread_title: Stub placement

message: In addition to the inaccuracies with the see also find-and-replace function detailed above, the script seems to be adding spaces to emdashes in contravention of MOS:DASH. This means having to go back through an article dash by dash and correct it after clicking "format" before saving the page. I would appreciate it if someone with the privilege to do so would fix this, as it really mitigates the benefits of using the script. Skomorokh 15:11, 27 December 2008 (UTC)
replies: text: What exactly needs to be changed, code-wise? §hep  •  ¡Talk to me! 06:09, 8 January 2009 (UTC)
replies: text:  Not done for now:Please provide an exact copy of the code that needs to be inserted.  The best method is to create a sandbox with the new code in it, so that the responding admin need only overwrite the protected page with the contents of the sandbox.--Aervanath talks like a mover, but not a shaker 18:55, 11 January 2009 (UTC)
replies: text: I don't know the code, but had hoped that in the two weeks that Wikipedians were enthusiastically clicking "format" and violating the MoS someone with technical knowledge would have deigned to grace us with their presence. Skomorokh 19:03, 11 January 2009 (UTC)
thread_title:  Adding bad formatting to dashes 

message: Should it be necessarily automated? Can't it be like User:Cameltrader/Advisor.js asking you about errors one by one? It's a script so surely it can produce unwanted changes and just correcting them all in one go is a bit too much I think. -- Mentifisto 11:18, 31 January 2009 (UTC)
replies: text: I'd love to have a configuration option that gives us a default choice. Or else two ways to activate the script, interactive or automatic. Usually I would prefer to fix errors interactively (sorry, I don't fully trust any automatic correcting tool), but if there are a lot of errors, then I'll just compare the differences after a fully-auto run. A really nice feature would be popup with checkboxes that lets us decided which fixes to make and whether we want interactive or full-auto. But that would require quite a bit more programming, I suppose. Sure would be nice, though! :-) --Willscrlt (→“¡¿Talk?!”) 03:47, 13 April 2009 (UTC)
thread_title:  Automated 

message: Per the notice above, if it is replaced by a more frequently updated Wikipedia:AutoEd, why not mark it historical and retire? Also: what functions of the formatter are not supported by AutoEd? --Piotr Konieczny aka Prokonsul Piotrus| talk  18:08, 27 April 2010 (UTC)
thread_title:  Mark as historical?