Forum:Persistent unwanted preformatted text

When a page is saved, occasionally a line is transformed into preformatted text. Looking at the source code, it appears that the line has a space preceding it. That space simply pops up there and is sometimes extremely persistent: removing it manually and saving the page again removed the preformat, but the next save is just as likely to revert it back to preformatted text. This even occurs on pages where no preformatted text is used at all. If I had to guess, I would say that it has something to do with tables, because I seem to remember this happening when text is inside a table of some sort (even a simple 1x1 table, but not only). This problem occurs to me and also my co-editor (Jagged Alliance 2 HAM wikia). Headrock 22:37, 30 June 2009 (UTC)


 * Getting text in pre tag when lines start with a space is normal wiki behavior.
 * Not been able to remove the space and save the page correctly must have something to do with the new editor, but you didn't mention using using it, but it's activated by default for new users, i think.
 * Try going to "source mode" or disabling the new editor in your prefs.
 * You could also give us a link to an example page... — TulipVorlax 09:10, 1 July 2009 (UTC)

I use the rich-text editor, but the problem occurs when saving in either mode. The space is unwanted, it appears magically. Removing it manually sometimes solves the problem, and sometimes the preformat reappears immediately after saving.

Here's an example page:. Go to section Calculating the Quantity of Trained Militia. The first line under that heading is preformatted when it shouldn't be. I must've erased the preceding space (in non-rich editor mode) a dozen times in the past, but it keeps coming back. I'm assuming that it has something to do with the table the text is in, because I seem to remember this only happening inside tables, but I'm not 100% sure about that. Also might have something to do with being the first line after a header. Headrock 12:27, 1 July 2009 (UTC)

UPDATE: I've run some tests, and it appears that this has nothing to do with tables. It has to do with Non-header Text immediately following a Header line. The rich-text editor has some flaw that causes them to be written into the source code like so: === Header Text === Non-Header Text

The lack of an empty line between the two of these causes the editor to automatically insert a space before the non-header text, turning it into preformatted text. I believe that the way to manually fix it (and prevent preformatted text from reappearing) is to manually insert an empty line between the two (in source view mode). However, I don't know how to prevent the problem from appearing in the first place, only how to react to it. Headrock 15:27, 1 July 2009 (UTC)


 * Ok, sorry for editing before having fully read in that case.
 * Looking at the code for the whole page, i see a real lot of "useless" empty lines. Or, in the "normal" editor, thoses are useless. If staff can reproduce, i think it's a bug that need to be fixed. — TulipVorlax 17:35, 1 July 2009 (UTC)

OK, I've just had this occur in the middle of an article, nowhere near header lines, so I guess that assumption is out the window as well. Two persistent preformatted lines in the same document, which cannot be removed using the rich editor (they both reappear upon saving the page). I haven't tried the code editor yet - I figured I would leave this as is, so you could test it yourself:. Enjoy. — Headrock 03:17, 3 July 2009 (UTC)


 * Does it happen on many pages ? I think maybe you should use special:contact to get their attention faster. — TulipVorlax 04:10, 3 July 2009 (UTC)


 * Headrock: Thanks for posting here because I (and I'm sure others) want to know what trouble to look for from the new editor. I saw an edit today where &lt;nowiki&gt; tags were placed around an asterisk (in the middle of a line), and I strongly suspect the editor did not do that (something else was changed a few lines away). At the Vim Tips wiki we have a lot of weird symbols in the text (Vim is a programmer's text editor), and I'm dreading what this editor will do to mess up or obfuscate our wikitext. JohnBeckett 07:39, 3 July 2009 (UTC)


 * I can reproduce this when the heading is within a table. Very strange, and we'll get it sorted! 16:48, 3 July 2009 (UTC)

Well, I don't know if you've actually fixed it, but I've just finished writing up a rather large and complex article and the problem did not appear. Of course, due to the randomness of the issue, there's no telling whether I just got lucky... It's good to know that you're aware of the problem though. Good luck in any case! - Headrock 01:03, 5 July 2009 (UTC)


 * It's fixed in our code, but not live yet - however, it should be live mid-week. 14:58, 6 July 2009 (UTC)