formattingmediawikiline-breakswikimediawikitext

New line character used in Wikimedia


What is the newline character used in Wikimedia projects formatting?

Because there is no undo, redo, or easy/fast save mechanism, I wrote a Wikimedia page in a normal text editor. Unfortunately, when I pasted it to my Wikimedia entry, all the new lines are gone.

I have tried using \n, \r, \n\r, \n\n, \r\r, \n\r\n\r, <br>, and <p></p> as my line breaks. However, none of them work. In the case of my \n, \r variations, nothing happens. In the case of the html tags, I get line breaks, but none of the other formatting works.

What is going on here? How do I fix this?

EDIT: I have also tried \r\n.

Addendum: Text recovery now works for me, after upgrading to 1.24.


Solution

  • Sob, please don't make newlines manually. If you really need to use a local text editor, save text in UTF-8 encoding, UNIX newlines (\n), and use that.

    Moving stuff around manually is not ideal either, especially as you will have to guess the markup because you can't have local parsing. It's going to be a pain. Use proper software, i.e. LibreOffice, and use the wiki-publisher tool which handles markup conversion automatically (as well as publishing via API if you wish).

    P.s.: In all my browsers, undo, redo and text recovery work perfectly in MediaWiki's editor. Try using a modern browser.