This tool will fix hyphens, dashes, and minus signs per MOS:DASH. It works better than the other tools I've heard of.
To install, add the following line to your personal JavaScript page:
importScript('User:GregU/dashes.js');
Then hit refresh in your browser. The installed script will add a "–" tab to the drop-down tab at the top, located between the 'watchlist star' and the search box (using the vector.js skin)
You can use the "–" tab when you're viewing an article or when you're already editing it. Pressing it will make the fixes, leaving you viewing the changes. You should review the changes because the tool will occasionally (rarely) make a mistake. You can undo changes or make your own changes, then hit "Save page" when done.
See also: hotkeys.js – Firefox tool for easily typing dashes (or other symbols or macros)
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hello again! I have another smallish feature request which you might wish to add: The tool corrects page ranges, such as "pp. 85-97" correctly. However, in cases like "p. 101-114", the hyphen is preserved. It is of course reasonable to expect that "p." is followed by a single page number, but unfortunately opposite cases are rather common. So my suggestion would be correcting the hyphen and also changing the "p." to "pp.".
About the spaced em dash case – the reason I brought this up was the MOS statement: Em dashes should not be spaced. This is easy to fix by removing the spaces or converting the em dash to en dash. Also, I don't see much room for false positives, when this is done only between two words. They shouldn't occur inside templates, URLs, wikilinks or filenames. Do you find the use of spaced em dashes stylistically acceptable and not a real issue? This could of course be made an optional feature. I, however, don't see any reasons for this not be added. — Quibik ( talk) 15:34, 16 October 2009 (UTC)
Will you include a set of instructions, for wikidummies? Auntieruth55 ( talk) 15:04, 4 November 2009 (UTC)
I think this tool should not touch dashes in the title= or work= parameters of references to books, magazines, or any web-based resource. It is wrong to insert a particular type of dash where a different one exists in the original. -- Simple Bob ( talk) 10:28, 12 November 2009 (UTC)
Hi. You added the "standalone" feature to the script nearly 2 weeks ago and this has been causing an unwanted side-effect for me since then. As I understand it, the "if (importScript("Wikipedia:AutoEd/core.js")" part is intended to return false and not continue, if the "AutoEd/core.js" has already been imported. Of course I am importing that script in my monobook.js as well. However, I am doing it the way the AutoEd scripts (for example Wikipedia:AutoEd/basic.js) implemented it: using full URLs. So the new feature is not working as intended for me. This not only adds an unnecessary extra button for me, but also hijacks the AutoEd button and converts it to a duplicate of the dashes.js one. Presumably, when the script is added to the core AutoEd functionality, full URLs will be used as well. So, I think this problem should be looked into. Perhaps moving the standalone button functionality to a separate script?
On another, slightly related topic: what do you think about changing the edit summary to "fixed [[MOS:DASH|dashes]] using a [[User:GregU/dashes.js|script]]? I am not particularly fond of using a linked em dash – it is hard to spot it as being a link to something (unless this was intentional, of course). — Quibik ( talk) 22:28, 14 November 2009 (UTC)
If you run the dashes.js on a revision of Stalinist architecture, then the script behaves unexpectedly. The problematic part is:
<gallery> Image:Moscow_mokhovaya_3.jpg|[[Mokhovaya Street Building]], by [[Ivan Zholtovsky]], [[1931]]-[[1934]] Image:Manege4.jpg|[[Moskva Hotel]], by [[Alexey Shchusev]], [[1932]]-[[1935]] Image:Langman_sto.jpg|[[STO Building]], by [[Arkady Langman]], 1932-1935 Image:Moscow_Northern_river_terminal.jpg|[[Northern River Terminal]] of [[Moscow Canal]], by [[Alexey Rukhlyadev]], [[1937]] </gallery>
The hyphens in the year ranges are corrected, as is expected. However, in the case of the wikilinked years, the right side of the dash is removed. — Quibik ( talk) 16:51, 3 January 2010 (UTC)
At MOS:DASH, for the purpose of expressing an interruption in a sentence, the guideline allows either an em dash without a space to either side or, to fill the exact same need, a spaced en dash. These two configurations are not supposed to be present in the same article—one of the two styles should be settled upon for consistency.
As well at MOS:DASH, the guideline allows absolutely no instance of a space before or a space after an em dash, including coded non-breaking spaces.
In this script-assisted edit by Mm40, the article about Adolf Hitler was given some corrections such as the changing of incorrectly used hyphens to dashes, but all of the existing em dashes with incorrect preceding or trailing spaces were allowed to retain them. Also, the article was allowed to retain its combination of em dashes and spaced en dashes that were used for the same purpose, a condition that existed before Mm40 started the script, but one which wasn't corrected. Shouldn't the script have prompted the editor to consolidate all the em dashes and spaced en dashes into one style, for consistency? If the editor then chooses em dashes, shouldn't the editor be prompted to eliminate all flanking spaces, including HTML-encoded non-breaking spaces? Binksternet ( talk) 00:19, 8 January 2010 (UTC)
The script has been pretty good about fixing ranges in sports scores, but for some reason it has not been fixing losses in NFL season pages. See for example 2009 Houston Texans season#Regular season, where the script fixed the scores marked with a "W" for win, but not those with a "L" for loss. Dabomb87 ( talk) 21:39, 17 January 2010 (UTC)
I was wondering if it would be more beneficial to, instead of replacing &mdash ; or the like with just a dash in the raw article (the one seen while editing), that this script could insert the Wikicode equivalents? (mdash, ndash). I think it would make editing easier for future editors, as they will be able to more clearly distinguish the different types of dashes. Regards, Airplaneman talk 01:23, 24 February 2010 (UTC)
I noticed that this script replaces entities such as &endash; with the bare character such as –. The desirability of one variant over another isn't addressed in the MOS (unless I'm mistaken) so I respectfully ask: why make the change? — Notyourbroom ( talk) 23:34, 7 April 2010 (UTC)
I think this tool should not be used to make an edit whereby the only change is to edit the appearance of the dashes e.g. [1]. Has any guidance been produced on use of this tool, and has this point been brought up before? Regards. Eldumpo ( talk) 11:51, 28 January 2011 (UTC)
I always just have other people run a script and fix my articles, but I should learn how to do this. What do I do? The code looks complicated. :( TCO ( talk) 06:30, 23 March 2011 (UTC)
importScript("User:GregU/dashes.js");
OK. So I created that page (didn't have one). And then added that content.
It told me to hold control and click refresh button (IE). I did that. I assume by refresh button, the mean the in browser refresh, not some function key.
So, what do I do now? How do I act like Malleus and fix dashes in my articles?
TCO ( talk) 20:39, 24 March 2011 (UTC)
Nice! Thanks for this, and the easy to use instructions above. Stephenjh ( talk) 14:55, 12 November 2011 (UTC)
Hello, I wanted to inform you all guys that you can use {{ User Dashes script}} to show involvement and inform other editors. Thanks. Pelmeen10 ( talk) 13:48, 24 March 2011 (UTC)
Hi
Can anyone tell me if these edits are correct? [3]
It seems that the script is not changing mdashes to ndashes in date ranges. From the basic description it seems that the script is not designed to do that, is this correct?
If so, can someone tell me of a script that would do this? Chaosdruid ( talk) 22:59, 28 April 2011 (UTC)
Could instructions on how to use it with AutoEd be added? AutoEd page is of little help, it claims "selecting your own modules (sets of automatically-made changes) is actually pretty easy" - which is rubbish, as the "instructions" that follow are very much in some high codery that does not tell me how to use this script with AutoEd. -- Piotr Konieczny aka Prokonsul Piotrus| talk 16:13, 1 July 2011 (UTC)
Is it possible to use this tool in another Wikipedia? If it's possible, how? This is a really handy tool! -- Stryn ( talk) 09:39, 1 August 2011 (UTC)
When nothing is changed, the script currently already suppressed the edit summary, but it still checks the "minor edits only" field. This should only happen if the user has changed part of the content with this script. Thanks, -- The Evil IP address ( talk) 20:50, 6 November 2011 (UTC)
Even when following the instructions on custom listing AutoEd modules, I can't get dashes to run with AutoEd. I commented out dashes.js from my common.js and ran a test on my sandbox. It worked as I expected, fixing whitespace and HTML entities. I then added dashes.js back to my common.js and ran another test; this time it only fixed the dashes. I've previously asked for help at AutoEd. Importing dashes.js seems to exclude all other AutoEd modules. Should I change my configuration or is this a bug? Thanks! — danhash ( talk) 20:08, 21 November 2011 (UTC)
The script shouldn't change the titles of works, for example as used in the cite templates, see this edit as an example. It's very annoying to revert these "fixes". -- The Evil IP address ( talk) 20:09, 23 December 2011 (UTC)
<ref>...</ref>
tags. —
danhash (
talk)
22:56, 15 March 2012 (UTC)
The actions of the script seems to create a dysfunction of above script. It causes a disruption in functioning of 'hide' boxes where one lines of once-hidden text renders on-screen and several disappear completely. See this edit. -- Ohconfucius ¡digame! 06:20, 5 March 2012 (UTC)
Hi,
I've installed the script as directed, but there is no tab at the top to call the script. How do I run it once it's installed?
Thanks, MathewTownsend ( talk) 17:51, 5 March 2012 (UTC)
Please refer to this thread, which points out apparent undesirable change in functioning of external linking. -- Ohconfucius ¡digame! 22:43, 29 March 2012 (UTC)
Hi. This run of the script appears to have missed the hyphen in the last paragraph of the "Early and medieval age" of the article (975 -1187 CE). -- Stfg ( talk) 10:31, 15 April 2012 (UTC)
It looks like this script plays badly with the "background" field in {{ Infobox musical artist}}. The field takes its value from a predefined list of string tokens such as "solo_singer" and "non_performing_personnel", and removing the underscores breaks it. — Paul A ( talk) 03:08, 30 April 2012 (UTC)
This edit broke a row of a table. Can the script be updated to leave table syntax alone? Thanks, Melchoir ( talk) 03:39, 17 May 2012 (UTC)
Hi,
This is really cool and I'd like to use it but I'm not Java script savvy. Is it possible that this might become an app on the toolserver?
Great job!-- CaroleHenson ( talk) 01:48, 12 September 2012 (UTC)
This tool breaks Project Gutenberg links which contain a string like "1612-1680". Graham 87 04:54, 5 October 2012 (UTC)
Various Boeing planes have numerical model designations that include hyphens (and I'm sure there are other companies using similar schemes). For example, the first extended-fuselage version of the Boeing 737 was designated the 737-200, at which point the original model became the 737-100. These are correctly written as 737hyphen200 and so on. They are not number ranges, so a dash is not appropriate. Likewise, in sections of text that refer frequently to the different model designations, editors often write something like "The -200 was an extended version of the -100" (hyphen200, and so on), eliding the repetition of "737". These are not negative numbers so a minus sign is not appropriate.
Please be careful to avoid introducing these errors when using the dashes script. Undoing these errors is time-consuming because it's hard to search for dashes and minus signs and because a default install of Firefox edits pages in a monospaced font that uses the same (or near-identical) glyphs for dashes, hyphens and minus signs. Dricherby ( talk) 09:51, 17 October 2012 (UTC)
I've just installed this, and I can see the minus sign in the tabs at the top. When I click on it, the article opens but nothing happens. No changes are made. Can someone advise? SlimVirgin (talk) 23:19, 18 October 2012 (UTC)
importScript("User:Shubinator/DYKcheck.js");
' is the only line which is unique to the non-functioning monobook. Try removing it. --
Ohconfucius
ping / poke
09:35, 20 October 2012 (UTC)importScript("User:Shubinator/DYKcheck.js");
' from SV but it didn't work. I'm thinking it might be something in SV's Wikipedia preferences. I set SV II up with different preferences for troubleshooting after one of the Foundation's centralized changes conflicted with something in SV's preferences, though I forget all the details. So it's probably something like that again.
SlimVirgin
(talk)
18:30, 20 October 2012 (UTC)I have one small question/ something to say, in the edit when I edit it says : fixed dashes using a script wouldn't it be better if it says : Fixed dashes using a script. with a capital F ? Redalert2fan ( talk) 19:37, 26 October 2012 (UTC)
Dashes seems to be down for me right now. I know the techies have been doing a lot of tinkering the last couple of days. The problem seems to be related to changes to AutoEd Core or AutoEdFunction. -- Ohconfucius ping / poke 02:44, 27 October 2012 (UTC)
Does dashes seem to be down again right now? Fyunck(click) ( talk) 11:36, 20 January 2013 (UTC)
If there's a redirect to a section name from another article and the tool changes that section name, does the tool search for the redirect and repair it? Or does it just silently break the redirect?— Kww( talk) 04:16, 24 April 2013 (UTC)
See how both versions of the Subsection 2 link work, while one of the Subsection 1 links doesn't work because of the difference? By the way, I have my text zoomed to 500%, and I still can't see a difference between the pairs of headers as I type. I can see a subtle difference in the rendered text, though. I guess the designers of the monospace font weren't informed that the characters are different.— Kww( talk) 20:09, 25 April 2013 (UTC)
I did mention that I customised my tool to retrain certain links – specific instances where the articles all reside at the 'dash-ed' namespace (ie change '2007-08 season' to '2007–08 season'). Again, I don't see these specific targeted changes as being problematic; they are improved because it bypasses the redirect altogether. No links are "broken". -- Ohconfucius ping / poke 02:12, 26 April 2013 (UTC)
Some editors add a marker of some sort adjacent to the header indicating an anchor to particular section headings, but many don't. I mean how is the average editor (even a very experienced one) ever to know, when changing any section heading for any reason (not just hyphens or dashes), that there is an 'incoming' section link in the absence of such declarations? Whilst it's de rigeur for a bot to be able to deal with such situations in an error-free manner, the same level of exigence has never been required for scripts as there is significant user judgement to be exercised.
Things will happen every day through inadvertence. For example, how many times have you clicked on a link to not find the section you were looking for? Fact is, it will still land you on the same page, and you still manage to find the info you were after. There are also bots that go around fixing internal linkings. It's on that level that I'm commenting that the problem you describe seems to be overstated. -- Ohconfucius ping / poke 04:10, 26 April 2013 (UTC)
Please note that the script converts names of files with hyphens (to dashes) like it did here. -- Ohc ¡digame!¿que pasa? 17:22, 13 September 2013 (UTC)
I am told that this script changes links that point to English Wikisource, and the example that I was given was some of the links for {{ cite DNB}}. Can I ask that the relevant changes are made so that this does not happen. The script should not be changing links for interwiki, sister links or offsite urls, or templates that are used to for such urls/links. TIA for the relevant correction(s) to the script. — billinghurst sDrewth 13:31, 9 October 2013 (UTC)
Hi Greg, great tool, but when I install it stops VE working. Any idea? Edgepedia ( talk) 21:22, 30 January 2014 (UTC)
I use this a lot to fix simple hyphens and replacing ndash (thanks). But I'm noticing that certain pages cannot be fixed with this script. Most recently.. 1989 Virginia Slims Championships – Singles and 1987 Virginia Slims Championships – Singles with all their many ndashes. I've come across this from time to time and I'm wondering what it is with articles like these that will not allow your script to function. Thanks. Fyunck(click) ( talk) 23:04, 24 February 2014 (UTC)
Identifiers | |
---|---|
CAS Number |
Identifiers | |
---|---|
CAS Number |
Just thought you should know. Best regards, Seppi333 ( Insert 2¢ | Maintained) 21:29, 21 May 2014 (UTC)
The script seems to have broken an HTML comment here.— Chowbok ☠ 18:59, 20 June 2014 (UTC)
I'm being told to immediately stop using this scrip, on my talkpage here. Can someone chime in, at that conversation? Tx. -- Epeefleche ( talk) 17:46, 26 September 2014 (UTC)
Hi! This really is an excellent tool. Would it be possible for me to add the script to the Welsh Wikipedia? If so I would copy and paste the page, translating the names of the months but leaving the rest mostly as it is. Would this be acceptable or would it be too primitive? (I'm not an expert at Javascript.) The filename would be in my userspace unless you'd prefer to create an account yourself. Please ping me back here. Ham ( talk) 14:24, 5 November 2014 (UTC)
This is an excellent tool and will no doubt prove to be a great tome saver. My only query is whether it would be possible to relocate the link to invoke it to the sidebar instead of the "More" menu, as the latter is a little more fiddly to access, particularly on a touch-screen which requires more precise pointing to tap the icons. Other scripts provide uncluttering and en masse corrections (e.g., date format conversions) on the sidebar, so it would be convenient to have this one in the same place. Just a thought.
Thanks for the top work! — sroc 💬 17:42, 8 December 2014 (UTC)
Would it be possible to use the {{ snd}} template for spaced en dashes rather than using a soft space that could wrap around the line before the dash?
With a spaced en dash | With the {{ snd}} template |
---|---|
This is what an example could look like – with an en dash on the next line. |
This is what an example could look like – with an en dash on the same line as the previous word. |
— sroc 💬 13:41, 10 December 2014 (UTC)
Is it known what causes AutoEd not to function together with dashes in Chrome? -- JorisvS ( talk) 15:21, 19 December 2014 (UTC)
In ranges of the form XXX<ref>...</ref>-YYY(<ref>...</ref>), this script does not detect that the hyphen should be replaced with an endash. Is it possible to fix this? -- JorisvS ( talk) 11:53, 12 March 2015 (UTC)
During this edit using this script, it failed to find this hyphen to fix to an endash. -- JorisvS ( talk) 08:44, 22 May 2015 (UTC)
When JorisvS made this edit with this script, it resulted in the location map being entirely broken, since the template can't tell that the Unicode symbol that sort of looks like a negative sign is meant to be a negative sign. Can this be fixed? Thanks, Jackmcbarn ( talk) 17:55, 25 May 2015 (UTC)
At Scholz's star (among others, I've seen this before), it fails to find "|prop_mo_ra=-40.3 ± 0.2{{r|Burgasser2015|Mamajek2015}}" and "|prop_mo_dec=-114.8 ± 0.4{{r|Burgasser2015|Mamajek2015}}" to fix those hyphens to minus signs. -- JorisvS ( talk) 08:01, 28 May 2015 (UTC)
I see this was topic that came up here in 2009, but wasn't sure it was addressed. I noticed today this script being used to change the titles of sources en masse, and I feel that goes against the principle of verifiability. I do feel that if a source has a misspelling in its title, we shouldn't correct it in our citations, or if it uses the wrong punctuation, that changing it makes less verifiable for current and future users. It is a bit of an issue of minutia, but I was wondering, has anyone had endeavored to ensure that this script doesn't affect hyphens/dashes inside a "title" field the way it won't change a URL or math equation?-- Patrick, oѺ∞ 17:25, 3 August 2015 (UTC)
Please see Jean Sibelius revert. @ Mirokado: Just so you know, what happened on Jean Sibelius was this tool that I was using. It's a widely-used tool on Wikipedia. So if there is a flaw in how it's treating ISBNs, it needs to be logged here. If it was wrong on Jean Sibelius, the tool is wrong on countless other articles. I don't know what happened, but I've never seen the tool change ISBN numbers before. I've used this tool on hundreds of my own creations, and it never bothered with ISBN numbers on them. Strange occurrence. Please feel free to add your comments. — Maile ( talk) 23:53, 8 December 2015 (UTC)
Appears to still be breaking at least some ISBNs. See this change that I just reverted (by hand). Unless there's a newer version of the tool than what was used there. -- Floatjon ( talk) 17:43, 27 October 2016 (UTC)
This usually works but I know there are some troublesome articles where hyphens and ndash-script don't get changed. One of them is 2006 Hastings Direct International Championships – Doubles. Why does it have trouble converting the &ndash:-script into a "–" on this article? Fyunck(click) ( talk) 08:16, 5 February 2016 (UTC)
Just got a complaint. Tony (talk) 05:06, 6 April 2016 (UTC)
Should this page be linked to from MOS:DASH, perhaps in a 'See also' section? It would certainly make this script easier to find for those trying to look for it. (I went to MOS:DASH first trying to find this script, and was frustrated when it was [not] linked to from there...) -- IJBall ( contribs • talk) 23:02, 12 May 2016 (UTC)
A year ago, the use of "present" got added to MOS:DATERANGE. What got agreed on was whether or not a spaced endash was to be used, and that the lower case 'p' be used. You might want to consider adding this to the functionality of your script. The capital 'P' is quite common and should be simple to capture (says he who doesn't do any programming). Keep up your good work! Schwede 66 20:09, 20 January 2017 (UTC)
Why is this necessary and can the code be tweaked so it doesn't do this? I'm talking about the spacing between equal signs and the header text. From MOS:HEAD: "Spaces around the Title (e.g. == Title ==) are optional and ignored." -- Jennica✿ / talk 23:37, 14 March 2017 (UTC)
Hey, who coded "from X–Y" to change to "from X to Y", and "between X–Y" to change to "between X and Y".
Great work!
Tony (talk) 04:24, 25 March 2017 (UTC)
This edit by
Ham II indicates a conflict between this script and
Extension:Score, which is used for generating musical scores (see also
Help:Score). The score extension uses the --
syntax to indicate syllable divisions in lyrics, to place syllables against notes to which they are sung.
The edit changed --
to –
within the score syntax, which had the effect of misplacing the words in the score displayed in the article.
The solution appears to be to change the script so that it does not make changes to score extension syntax, that is it should not make any changes between the <score
and </score
tags.
Verbcatcher (
talk)
16:08, 23 August 2017 (UTC)
Not sure if this has been raised before, but it does not work in some cases, such as 2017–18 Calcutta Premier Division. There are a few instances of '2-1' on these pages, which are not converted while using the script. Coderzombie ( talk) 15:42, 24 September 2017 (UTC)
I installed the script and got two dash tabs which pop up in different places each time I click on an article. Is this normal? Regards Keith-264 ( talk) 21:49, 7 December 2017 (UTC)
In this edit
[5] by @
Jerome Kohl: hyphens inside a <ce>...</ce>
tag were changed to en-dashes. <ce>
is basically another form of the <math>
mode tag which needs hyphens for correct LaTeX processing. The same applies to <chem>
.
I think the lines
var m = string.slice(pos).search(/<\/?(math|pre|code|tt|source|syntaxhighlight|gallery)\b/i);
if (m >= 0 && string.charAt(pos+m+1) == '/')
return str; // don't break a <math> equation, or source code
need to be changed to include the ce and chem tags.-- Salix alba ( talk): 05:53, 5 January 2018 (UTC)
Should not insert a space after a non-breaking space. AdA&D ★ 22:34, 28 February 2018 (UTC)
Not sure if it's just me but the script doesn't appear to be working anymore. Del♉sion23 (talk) 20:02, 3 March 2018 (UTC)
{{
Drugbox}}
|InChI=
and |StdInChI=
parameter exclusion
This script should ignore any dashes that are present in these template parameters. Can someone code an exclusion for this? An example edit where the script attempted to change these compound identifiers is Special:Diff/847232527/847232613. Seppi333 ( Insert 2¢) 21:01, 23 June 2018 (UTC)
In the following revision the script was used to 'fix' hyphens in a Graph:Chart template: https://en.wikipedia.org/?title=Venezuela&diff=796822938&oldid=796334411
The chart template expects a hyphen-minus, not a minus sign,for negative numbers, and replacing it will result in the numerical data being interpreted as categorical data.
Fnuciton ( talk) 15:21, 25 October 2018 (UTC)
The script breaks interlanguage links. ( [6]) Koopinator ( talk) 09:08, 22 June 2019 (UTC)
When I add this near the top of User:SMcCandlish/common.js, I get the "-" for this item showing up twice under my "More ˬ" menu (in my top menu bar), and it also makes "auto ed" (normally the only item in that "More ˬ" menu) disappear. — SMcCandlish ☏ ¢ 😼 07:42, 18 November 2019 (UTC)
This tool will fix hyphens, dashes, and minus signs per MOS:DASH. It works better than the other tools I've heard of.
To install, add the following line to your personal JavaScript page:
importScript('User:GregU/dashes.js');
Then hit refresh in your browser. The installed script will add a "–" tab to the drop-down tab at the top, located between the 'watchlist star' and the search box (using the vector.js skin)
You can use the "–" tab when you're viewing an article or when you're already editing it. Pressing it will make the fixes, leaving you viewing the changes. You should review the changes because the tool will occasionally (rarely) make a mistake. You can undo changes or make your own changes, then hit "Save page" when done.
See also: hotkeys.js – Firefox tool for easily typing dashes (or other symbols or macros)
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hello again! I have another smallish feature request which you might wish to add: The tool corrects page ranges, such as "pp. 85-97" correctly. However, in cases like "p. 101-114", the hyphen is preserved. It is of course reasonable to expect that "p." is followed by a single page number, but unfortunately opposite cases are rather common. So my suggestion would be correcting the hyphen and also changing the "p." to "pp.".
About the spaced em dash case – the reason I brought this up was the MOS statement: Em dashes should not be spaced. This is easy to fix by removing the spaces or converting the em dash to en dash. Also, I don't see much room for false positives, when this is done only between two words. They shouldn't occur inside templates, URLs, wikilinks or filenames. Do you find the use of spaced em dashes stylistically acceptable and not a real issue? This could of course be made an optional feature. I, however, don't see any reasons for this not be added. — Quibik ( talk) 15:34, 16 October 2009 (UTC)
Will you include a set of instructions, for wikidummies? Auntieruth55 ( talk) 15:04, 4 November 2009 (UTC)
I think this tool should not touch dashes in the title= or work= parameters of references to books, magazines, or any web-based resource. It is wrong to insert a particular type of dash where a different one exists in the original. -- Simple Bob ( talk) 10:28, 12 November 2009 (UTC)
Hi. You added the "standalone" feature to the script nearly 2 weeks ago and this has been causing an unwanted side-effect for me since then. As I understand it, the "if (importScript("Wikipedia:AutoEd/core.js")" part is intended to return false and not continue, if the "AutoEd/core.js" has already been imported. Of course I am importing that script in my monobook.js as well. However, I am doing it the way the AutoEd scripts (for example Wikipedia:AutoEd/basic.js) implemented it: using full URLs. So the new feature is not working as intended for me. This not only adds an unnecessary extra button for me, but also hijacks the AutoEd button and converts it to a duplicate of the dashes.js one. Presumably, when the script is added to the core AutoEd functionality, full URLs will be used as well. So, I think this problem should be looked into. Perhaps moving the standalone button functionality to a separate script?
On another, slightly related topic: what do you think about changing the edit summary to "fixed [[MOS:DASH|dashes]] using a [[User:GregU/dashes.js|script]]? I am not particularly fond of using a linked em dash – it is hard to spot it as being a link to something (unless this was intentional, of course). — Quibik ( talk) 22:28, 14 November 2009 (UTC)
If you run the dashes.js on a revision of Stalinist architecture, then the script behaves unexpectedly. The problematic part is:
<gallery> Image:Moscow_mokhovaya_3.jpg|[[Mokhovaya Street Building]], by [[Ivan Zholtovsky]], [[1931]]-[[1934]] Image:Manege4.jpg|[[Moskva Hotel]], by [[Alexey Shchusev]], [[1932]]-[[1935]] Image:Langman_sto.jpg|[[STO Building]], by [[Arkady Langman]], 1932-1935 Image:Moscow_Northern_river_terminal.jpg|[[Northern River Terminal]] of [[Moscow Canal]], by [[Alexey Rukhlyadev]], [[1937]] </gallery>
The hyphens in the year ranges are corrected, as is expected. However, in the case of the wikilinked years, the right side of the dash is removed. — Quibik ( talk) 16:51, 3 January 2010 (UTC)
At MOS:DASH, for the purpose of expressing an interruption in a sentence, the guideline allows either an em dash without a space to either side or, to fill the exact same need, a spaced en dash. These two configurations are not supposed to be present in the same article—one of the two styles should be settled upon for consistency.
As well at MOS:DASH, the guideline allows absolutely no instance of a space before or a space after an em dash, including coded non-breaking spaces.
In this script-assisted edit by Mm40, the article about Adolf Hitler was given some corrections such as the changing of incorrectly used hyphens to dashes, but all of the existing em dashes with incorrect preceding or trailing spaces were allowed to retain them. Also, the article was allowed to retain its combination of em dashes and spaced en dashes that were used for the same purpose, a condition that existed before Mm40 started the script, but one which wasn't corrected. Shouldn't the script have prompted the editor to consolidate all the em dashes and spaced en dashes into one style, for consistency? If the editor then chooses em dashes, shouldn't the editor be prompted to eliminate all flanking spaces, including HTML-encoded non-breaking spaces? Binksternet ( talk) 00:19, 8 January 2010 (UTC)
The script has been pretty good about fixing ranges in sports scores, but for some reason it has not been fixing losses in NFL season pages. See for example 2009 Houston Texans season#Regular season, where the script fixed the scores marked with a "W" for win, but not those with a "L" for loss. Dabomb87 ( talk) 21:39, 17 January 2010 (UTC)
I was wondering if it would be more beneficial to, instead of replacing &mdash ; or the like with just a dash in the raw article (the one seen while editing), that this script could insert the Wikicode equivalents? (mdash, ndash). I think it would make editing easier for future editors, as they will be able to more clearly distinguish the different types of dashes. Regards, Airplaneman talk 01:23, 24 February 2010 (UTC)
I noticed that this script replaces entities such as &endash; with the bare character such as –. The desirability of one variant over another isn't addressed in the MOS (unless I'm mistaken) so I respectfully ask: why make the change? — Notyourbroom ( talk) 23:34, 7 April 2010 (UTC)
I think this tool should not be used to make an edit whereby the only change is to edit the appearance of the dashes e.g. [1]. Has any guidance been produced on use of this tool, and has this point been brought up before? Regards. Eldumpo ( talk) 11:51, 28 January 2011 (UTC)
I always just have other people run a script and fix my articles, but I should learn how to do this. What do I do? The code looks complicated. :( TCO ( talk) 06:30, 23 March 2011 (UTC)
importScript("User:GregU/dashes.js");
OK. So I created that page (didn't have one). And then added that content.
It told me to hold control and click refresh button (IE). I did that. I assume by refresh button, the mean the in browser refresh, not some function key.
So, what do I do now? How do I act like Malleus and fix dashes in my articles?
TCO ( talk) 20:39, 24 March 2011 (UTC)
Nice! Thanks for this, and the easy to use instructions above. Stephenjh ( talk) 14:55, 12 November 2011 (UTC)
Hello, I wanted to inform you all guys that you can use {{ User Dashes script}} to show involvement and inform other editors. Thanks. Pelmeen10 ( talk) 13:48, 24 March 2011 (UTC)
Hi
Can anyone tell me if these edits are correct? [3]
It seems that the script is not changing mdashes to ndashes in date ranges. From the basic description it seems that the script is not designed to do that, is this correct?
If so, can someone tell me of a script that would do this? Chaosdruid ( talk) 22:59, 28 April 2011 (UTC)
Could instructions on how to use it with AutoEd be added? AutoEd page is of little help, it claims "selecting your own modules (sets of automatically-made changes) is actually pretty easy" - which is rubbish, as the "instructions" that follow are very much in some high codery that does not tell me how to use this script with AutoEd. -- Piotr Konieczny aka Prokonsul Piotrus| talk 16:13, 1 July 2011 (UTC)
Is it possible to use this tool in another Wikipedia? If it's possible, how? This is a really handy tool! -- Stryn ( talk) 09:39, 1 August 2011 (UTC)
When nothing is changed, the script currently already suppressed the edit summary, but it still checks the "minor edits only" field. This should only happen if the user has changed part of the content with this script. Thanks, -- The Evil IP address ( talk) 20:50, 6 November 2011 (UTC)
Even when following the instructions on custom listing AutoEd modules, I can't get dashes to run with AutoEd. I commented out dashes.js from my common.js and ran a test on my sandbox. It worked as I expected, fixing whitespace and HTML entities. I then added dashes.js back to my common.js and ran another test; this time it only fixed the dashes. I've previously asked for help at AutoEd. Importing dashes.js seems to exclude all other AutoEd modules. Should I change my configuration or is this a bug? Thanks! — danhash ( talk) 20:08, 21 November 2011 (UTC)
The script shouldn't change the titles of works, for example as used in the cite templates, see this edit as an example. It's very annoying to revert these "fixes". -- The Evil IP address ( talk) 20:09, 23 December 2011 (UTC)
<ref>...</ref>
tags. —
danhash (
talk)
22:56, 15 March 2012 (UTC)
The actions of the script seems to create a dysfunction of above script. It causes a disruption in functioning of 'hide' boxes where one lines of once-hidden text renders on-screen and several disappear completely. See this edit. -- Ohconfucius ¡digame! 06:20, 5 March 2012 (UTC)
Hi,
I've installed the script as directed, but there is no tab at the top to call the script. How do I run it once it's installed?
Thanks, MathewTownsend ( talk) 17:51, 5 March 2012 (UTC)
Please refer to this thread, which points out apparent undesirable change in functioning of external linking. -- Ohconfucius ¡digame! 22:43, 29 March 2012 (UTC)
Hi. This run of the script appears to have missed the hyphen in the last paragraph of the "Early and medieval age" of the article (975 -1187 CE). -- Stfg ( talk) 10:31, 15 April 2012 (UTC)
It looks like this script plays badly with the "background" field in {{ Infobox musical artist}}. The field takes its value from a predefined list of string tokens such as "solo_singer" and "non_performing_personnel", and removing the underscores breaks it. — Paul A ( talk) 03:08, 30 April 2012 (UTC)
This edit broke a row of a table. Can the script be updated to leave table syntax alone? Thanks, Melchoir ( talk) 03:39, 17 May 2012 (UTC)
Hi,
This is really cool and I'd like to use it but I'm not Java script savvy. Is it possible that this might become an app on the toolserver?
Great job!-- CaroleHenson ( talk) 01:48, 12 September 2012 (UTC)
This tool breaks Project Gutenberg links which contain a string like "1612-1680". Graham 87 04:54, 5 October 2012 (UTC)
Various Boeing planes have numerical model designations that include hyphens (and I'm sure there are other companies using similar schemes). For example, the first extended-fuselage version of the Boeing 737 was designated the 737-200, at which point the original model became the 737-100. These are correctly written as 737hyphen200 and so on. They are not number ranges, so a dash is not appropriate. Likewise, in sections of text that refer frequently to the different model designations, editors often write something like "The -200 was an extended version of the -100" (hyphen200, and so on), eliding the repetition of "737". These are not negative numbers so a minus sign is not appropriate.
Please be careful to avoid introducing these errors when using the dashes script. Undoing these errors is time-consuming because it's hard to search for dashes and minus signs and because a default install of Firefox edits pages in a monospaced font that uses the same (or near-identical) glyphs for dashes, hyphens and minus signs. Dricherby ( talk) 09:51, 17 October 2012 (UTC)
I've just installed this, and I can see the minus sign in the tabs at the top. When I click on it, the article opens but nothing happens. No changes are made. Can someone advise? SlimVirgin (talk) 23:19, 18 October 2012 (UTC)
importScript("User:Shubinator/DYKcheck.js");
' is the only line which is unique to the non-functioning monobook. Try removing it. --
Ohconfucius
ping / poke
09:35, 20 October 2012 (UTC)importScript("User:Shubinator/DYKcheck.js");
' from SV but it didn't work. I'm thinking it might be something in SV's Wikipedia preferences. I set SV II up with different preferences for troubleshooting after one of the Foundation's centralized changes conflicted with something in SV's preferences, though I forget all the details. So it's probably something like that again.
SlimVirgin
(talk)
18:30, 20 October 2012 (UTC)I have one small question/ something to say, in the edit when I edit it says : fixed dashes using a script wouldn't it be better if it says : Fixed dashes using a script. with a capital F ? Redalert2fan ( talk) 19:37, 26 October 2012 (UTC)
Dashes seems to be down for me right now. I know the techies have been doing a lot of tinkering the last couple of days. The problem seems to be related to changes to AutoEd Core or AutoEdFunction. -- Ohconfucius ping / poke 02:44, 27 October 2012 (UTC)
Does dashes seem to be down again right now? Fyunck(click) ( talk) 11:36, 20 January 2013 (UTC)
If there's a redirect to a section name from another article and the tool changes that section name, does the tool search for the redirect and repair it? Or does it just silently break the redirect?— Kww( talk) 04:16, 24 April 2013 (UTC)
See how both versions of the Subsection 2 link work, while one of the Subsection 1 links doesn't work because of the difference? By the way, I have my text zoomed to 500%, and I still can't see a difference between the pairs of headers as I type. I can see a subtle difference in the rendered text, though. I guess the designers of the monospace font weren't informed that the characters are different.— Kww( talk) 20:09, 25 April 2013 (UTC)
I did mention that I customised my tool to retrain certain links – specific instances where the articles all reside at the 'dash-ed' namespace (ie change '2007-08 season' to '2007–08 season'). Again, I don't see these specific targeted changes as being problematic; they are improved because it bypasses the redirect altogether. No links are "broken". -- Ohconfucius ping / poke 02:12, 26 April 2013 (UTC)
Some editors add a marker of some sort adjacent to the header indicating an anchor to particular section headings, but many don't. I mean how is the average editor (even a very experienced one) ever to know, when changing any section heading for any reason (not just hyphens or dashes), that there is an 'incoming' section link in the absence of such declarations? Whilst it's de rigeur for a bot to be able to deal with such situations in an error-free manner, the same level of exigence has never been required for scripts as there is significant user judgement to be exercised.
Things will happen every day through inadvertence. For example, how many times have you clicked on a link to not find the section you were looking for? Fact is, it will still land you on the same page, and you still manage to find the info you were after. There are also bots that go around fixing internal linkings. It's on that level that I'm commenting that the problem you describe seems to be overstated. -- Ohconfucius ping / poke 04:10, 26 April 2013 (UTC)
Please note that the script converts names of files with hyphens (to dashes) like it did here. -- Ohc ¡digame!¿que pasa? 17:22, 13 September 2013 (UTC)
I am told that this script changes links that point to English Wikisource, and the example that I was given was some of the links for {{ cite DNB}}. Can I ask that the relevant changes are made so that this does not happen. The script should not be changing links for interwiki, sister links or offsite urls, or templates that are used to for such urls/links. TIA for the relevant correction(s) to the script. — billinghurst sDrewth 13:31, 9 October 2013 (UTC)
Hi Greg, great tool, but when I install it stops VE working. Any idea? Edgepedia ( talk) 21:22, 30 January 2014 (UTC)
I use this a lot to fix simple hyphens and replacing ndash (thanks). But I'm noticing that certain pages cannot be fixed with this script. Most recently.. 1989 Virginia Slims Championships – Singles and 1987 Virginia Slims Championships – Singles with all their many ndashes. I've come across this from time to time and I'm wondering what it is with articles like these that will not allow your script to function. Thanks. Fyunck(click) ( talk) 23:04, 24 February 2014 (UTC)
Identifiers | |
---|---|
CAS Number |
Identifiers | |
---|---|
CAS Number |
Just thought you should know. Best regards, Seppi333 ( Insert 2¢ | Maintained) 21:29, 21 May 2014 (UTC)
The script seems to have broken an HTML comment here.— Chowbok ☠ 18:59, 20 June 2014 (UTC)
I'm being told to immediately stop using this scrip, on my talkpage here. Can someone chime in, at that conversation? Tx. -- Epeefleche ( talk) 17:46, 26 September 2014 (UTC)
Hi! This really is an excellent tool. Would it be possible for me to add the script to the Welsh Wikipedia? If so I would copy and paste the page, translating the names of the months but leaving the rest mostly as it is. Would this be acceptable or would it be too primitive? (I'm not an expert at Javascript.) The filename would be in my userspace unless you'd prefer to create an account yourself. Please ping me back here. Ham ( talk) 14:24, 5 November 2014 (UTC)
This is an excellent tool and will no doubt prove to be a great tome saver. My only query is whether it would be possible to relocate the link to invoke it to the sidebar instead of the "More" menu, as the latter is a little more fiddly to access, particularly on a touch-screen which requires more precise pointing to tap the icons. Other scripts provide uncluttering and en masse corrections (e.g., date format conversions) on the sidebar, so it would be convenient to have this one in the same place. Just a thought.
Thanks for the top work! — sroc 💬 17:42, 8 December 2014 (UTC)
Would it be possible to use the {{ snd}} template for spaced en dashes rather than using a soft space that could wrap around the line before the dash?
With a spaced en dash | With the {{ snd}} template |
---|---|
This is what an example could look like – with an en dash on the next line. |
This is what an example could look like – with an en dash on the same line as the previous word. |
— sroc 💬 13:41, 10 December 2014 (UTC)
Is it known what causes AutoEd not to function together with dashes in Chrome? -- JorisvS ( talk) 15:21, 19 December 2014 (UTC)
In ranges of the form XXX<ref>...</ref>-YYY(<ref>...</ref>), this script does not detect that the hyphen should be replaced with an endash. Is it possible to fix this? -- JorisvS ( talk) 11:53, 12 March 2015 (UTC)
During this edit using this script, it failed to find this hyphen to fix to an endash. -- JorisvS ( talk) 08:44, 22 May 2015 (UTC)
When JorisvS made this edit with this script, it resulted in the location map being entirely broken, since the template can't tell that the Unicode symbol that sort of looks like a negative sign is meant to be a negative sign. Can this be fixed? Thanks, Jackmcbarn ( talk) 17:55, 25 May 2015 (UTC)
At Scholz's star (among others, I've seen this before), it fails to find "|prop_mo_ra=-40.3 ± 0.2{{r|Burgasser2015|Mamajek2015}}" and "|prop_mo_dec=-114.8 ± 0.4{{r|Burgasser2015|Mamajek2015}}" to fix those hyphens to minus signs. -- JorisvS ( talk) 08:01, 28 May 2015 (UTC)
I see this was topic that came up here in 2009, but wasn't sure it was addressed. I noticed today this script being used to change the titles of sources en masse, and I feel that goes against the principle of verifiability. I do feel that if a source has a misspelling in its title, we shouldn't correct it in our citations, or if it uses the wrong punctuation, that changing it makes less verifiable for current and future users. It is a bit of an issue of minutia, but I was wondering, has anyone had endeavored to ensure that this script doesn't affect hyphens/dashes inside a "title" field the way it won't change a URL or math equation?-- Patrick, oѺ∞ 17:25, 3 August 2015 (UTC)
Please see Jean Sibelius revert. @ Mirokado: Just so you know, what happened on Jean Sibelius was this tool that I was using. It's a widely-used tool on Wikipedia. So if there is a flaw in how it's treating ISBNs, it needs to be logged here. If it was wrong on Jean Sibelius, the tool is wrong on countless other articles. I don't know what happened, but I've never seen the tool change ISBN numbers before. I've used this tool on hundreds of my own creations, and it never bothered with ISBN numbers on them. Strange occurrence. Please feel free to add your comments. — Maile ( talk) 23:53, 8 December 2015 (UTC)
Appears to still be breaking at least some ISBNs. See this change that I just reverted (by hand). Unless there's a newer version of the tool than what was used there. -- Floatjon ( talk) 17:43, 27 October 2016 (UTC)
This usually works but I know there are some troublesome articles where hyphens and ndash-script don't get changed. One of them is 2006 Hastings Direct International Championships – Doubles. Why does it have trouble converting the &ndash:-script into a "–" on this article? Fyunck(click) ( talk) 08:16, 5 February 2016 (UTC)
Just got a complaint. Tony (talk) 05:06, 6 April 2016 (UTC)
Should this page be linked to from MOS:DASH, perhaps in a 'See also' section? It would certainly make this script easier to find for those trying to look for it. (I went to MOS:DASH first trying to find this script, and was frustrated when it was [not] linked to from there...) -- IJBall ( contribs • talk) 23:02, 12 May 2016 (UTC)
A year ago, the use of "present" got added to MOS:DATERANGE. What got agreed on was whether or not a spaced endash was to be used, and that the lower case 'p' be used. You might want to consider adding this to the functionality of your script. The capital 'P' is quite common and should be simple to capture (says he who doesn't do any programming). Keep up your good work! Schwede 66 20:09, 20 January 2017 (UTC)
Why is this necessary and can the code be tweaked so it doesn't do this? I'm talking about the spacing between equal signs and the header text. From MOS:HEAD: "Spaces around the Title (e.g. == Title ==) are optional and ignored." -- Jennica✿ / talk 23:37, 14 March 2017 (UTC)
Hey, who coded "from X–Y" to change to "from X to Y", and "between X–Y" to change to "between X and Y".
Great work!
Tony (talk) 04:24, 25 March 2017 (UTC)
This edit by
Ham II indicates a conflict between this script and
Extension:Score, which is used for generating musical scores (see also
Help:Score). The score extension uses the --
syntax to indicate syllable divisions in lyrics, to place syllables against notes to which they are sung.
The edit changed --
to –
within the score syntax, which had the effect of misplacing the words in the score displayed in the article.
The solution appears to be to change the script so that it does not make changes to score extension syntax, that is it should not make any changes between the <score
and </score
tags.
Verbcatcher (
talk)
16:08, 23 August 2017 (UTC)
Not sure if this has been raised before, but it does not work in some cases, such as 2017–18 Calcutta Premier Division. There are a few instances of '2-1' on these pages, which are not converted while using the script. Coderzombie ( talk) 15:42, 24 September 2017 (UTC)
I installed the script and got two dash tabs which pop up in different places each time I click on an article. Is this normal? Regards Keith-264 ( talk) 21:49, 7 December 2017 (UTC)
In this edit
[5] by @
Jerome Kohl: hyphens inside a <ce>...</ce>
tag were changed to en-dashes. <ce>
is basically another form of the <math>
mode tag which needs hyphens for correct LaTeX processing. The same applies to <chem>
.
I think the lines
var m = string.slice(pos).search(/<\/?(math|pre|code|tt|source|syntaxhighlight|gallery)\b/i);
if (m >= 0 && string.charAt(pos+m+1) == '/')
return str; // don't break a <math> equation, or source code
need to be changed to include the ce and chem tags.-- Salix alba ( talk): 05:53, 5 January 2018 (UTC)
Should not insert a space after a non-breaking space. AdA&D ★ 22:34, 28 February 2018 (UTC)
Not sure if it's just me but the script doesn't appear to be working anymore. Del♉sion23 (talk) 20:02, 3 March 2018 (UTC)
{{
Drugbox}}
|InChI=
and |StdInChI=
parameter exclusion
This script should ignore any dashes that are present in these template parameters. Can someone code an exclusion for this? An example edit where the script attempted to change these compound identifiers is Special:Diff/847232527/847232613. Seppi333 ( Insert 2¢) 21:01, 23 June 2018 (UTC)
In the following revision the script was used to 'fix' hyphens in a Graph:Chart template: https://en.wikipedia.org/?title=Venezuela&diff=796822938&oldid=796334411
The chart template expects a hyphen-minus, not a minus sign,for negative numbers, and replacing it will result in the numerical data being interpreted as categorical data.
Fnuciton ( talk) 15:21, 25 October 2018 (UTC)
The script breaks interlanguage links. ( [6]) Koopinator ( talk) 09:08, 22 June 2019 (UTC)
When I add this near the top of User:SMcCandlish/common.js, I get the "-" for this item showing up twice under my "More ˬ" menu (in my top menu bar), and it also makes "auto ed" (normally the only item in that "More ˬ" menu) disappear. — SMcCandlish ☏ ¢ 😼 07:42, 18 November 2019 (UTC)