Last modified: 2005-06-04 15:07:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 2312 - Automatically remove redundant whitespace, eg. double spaces
Automatically remove redundant whitespace, eg. double spaces
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
All All
: Lowest enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2005-06-03 22:46 UTC by Chris Wood
Modified: 2005-06-04 15:07 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Chris Wood 2005-06-03 22:46:20 UTC
Annoyingly, many editors use two spaces between sentences. This is ignored when
the page is rendered; how about automatically removing redundant whitespace like
this when edits are submitted?
Comment 1 Brion Vibber 2005-06-03 23:07:58 UTC
What benefit would this have?

Note that not all multiple whitespace is redundant, eg in preformatted text.

Inclined to WONTFIX this.
Comment 2 Dashiva 2005-06-03 23:27:23 UTC
There are more general cases where double newlines are needed. To get whitespace between a list and a heading you need two empty lines. One 
line has the same effect as zero. My understanding is that the list isn't a paragraph, so you need the first newline to kick the parser 
into paragraph mode.

And as a general case, I don't want the wiki to change the source unless I tell it to.
Comment 3 lɛʁi לערי ריינהארט 2005-06-04 02:37:25 UTC
in response to #c2
I tried to find a way to generate new lines using a temlate containing
(colon and non breaking space)

This works there (in CVS) but does not at [[en:User talk:Patrick#Template:Forced
new line]]. Does anybody know why and can provide another solution?

Regards Reinhardt [[user:gangleri]]
Comment 4 Brion Vibber 2005-06-04 02:41:54 UTC
Closing as WONTFIX.

Gangleri, that's totally unrelated to this issue.
Comment 5 Chris Wood 2005-06-04 02:51:39 UTC
Re comment #1 and comment #2
I said remove *redundant* whitespace... let's just focus on double spaces
between sentences: always redundant. This could be easily removed. Benefits:
Make wikitext more standard, easier to read, and save other people from removing
it manually.
Comment 6 Rowan Collins [IMSoP] 2005-06-04 15:07:58 UTC
(In reply to comment #5)
> I said remove *redundant* whitespace... let's just focus on double spaces
> between sentences: always redundant.

Not always:
* "<pre>foo  bar</pre>"
* the lines-beginning-with-a-space wiki markup ("\n foo  bar\n")
* <math>, <hiero>, etc
While all these situations *can* be detected, and already are in various parts
of the code, it's not actually as trivial as "remove all double spaces". 

The benefits you list don't really outweigh the effort of coding this correctly
(and introducing yet more complication into the already bloated parsing code)
and are questionable even in themselves: 
* the wikitext would be "more standard" in such a subtle way that no-one would
probably notice, while all sorts of more obvious things remained variable
* personally, I find double-spaces between sentences *easier* to read - as,
presumably, do the other editors who have a habit of inserting them
* and, frankly, anyone who feels compelled to make such trivial changes is only
getting what they ask for in terms of wasted effort - since it makes no
difference to anything, why not just leave it alone? [That's only an opinion,
obviously, but I certainly wouldn't spend my time *inserting* double spaces,
knowing that they wouldn't show up.]

Note You need to log in before you can comment on or make changes to this bug.