Topic on Project:Support desk

Suppressing replacement of line breaks with spaces

8
Tristan Lall (talkcontribs)

When editing plain text in a text editor, then copying it and pasting it into the MediaWiki edit field, all line breaks are replaced with spaces (immediately upon pasting, not upon submitting the edit). How can this be prevented (i.e. so that it functions like the edit box for this wiki)? This behaviour does not depend on whether the text editor's word wrap setting is enabled or disabled.

MediaWiki 1.16.2/PHP 5.3.8 (apache2handler)/MySQL 5.0.77-log. Wiki is restricted; can't provide access.

See also .

Bawolff (talkcontribs)

Probably something wrong with the program you're copying from, or your web browser.

Tristan Lall (talkcontribs)

Browser is Chrome 17, Internet Explorer 9 and Firefox 10; program is Word 2010, Notepad (Windows 7) and Notepad++ 5.9.2. But copying and pasting from within the edit box doesn't replace line breaks. I'm guessing that the wiki is silently inserting a placeholder character at the end of each line in its own edit box; if that's not present (i.e. it came from a regular plain or rich text editor), it filters the break out.

I think it's a wiki configuration thing, since this behaviour isn't present on any of the WMF wikis (that I know of). What do I change in the configuration options to make it go away (either per-user or globally)?

Tristan Lall (talkcontribs)

Also, when you paste text into the edit box, sometimes you the removal of line breaks is visible. (Slow script execution?) It goes in with the break, then a fraction of a second later, it removes the break.

Bawolff (talkcontribs)

Umm, the main difference between this site's edit box and the normal (Default) edit box is Extension:WikiEditor. Maybe try using that extension.

Tristan Lall (talkcontribs)

Already using WikiEditor (version 0.2.0). Also have UsabilityInitiative (Version 0.1.1) and Vector (Version 0.2.0), among others.

Zzmonty (talkcontribs)

Try adding this line to your MediaWiki:Common.css page

  1. mw-content-text p{
   white-space:pre-line;

}

This worked for me.

Reply to "Suppressing replacement of line breaks with spaces"