Description

The GUI editor removes spaces in tables. This results in the diffs between text and GUI editors to show unwanted whitespace changes which is not helpful. The editors should act consistently and should either both remove spaces or neither should remove spaces.

Steps to reproduce

  1. Create a new page with the text editor.
  2. Create a table. In each column include additional spaces.
     ||        leading and trailing spaces       || a ||
     || b || c ||
  3. Save the page.
  4. Re-edit the page, this time with the GUI editor.
  5. Save the page.
  6. Look at the diff of changes and note how the spaces have been trimmed.

Component selection

Details

MoinMoin Version

1.8, 1.8rc1

OS and Version

Linux 2.6

Python Version

Python 2.5.2

Server Setup

mod_python, fastcgi

Server Details

Apache 2.2

Language you are using the wiki in (set in the browser/UserPreferences)

en

Workaround

Use either the text editor or the GUI editor exclusively.

Discussion

Does using of verbatims help? I am not sure if blanks used for formatting for not teletyping fonts make sense. Can you show an example why you think so? -- ReimarBauer 2008-10-21 17:07:09 e.g.

||`        leading and trailing spaces       `|| a ||
|| b || c ||

        leading and trailing spaces       

a

b

c

My intention is not actually to preserve any whitespace, but rather to prevent noise shown in the diffs from the GUI editor removing spaces. The resulting page is still rendered the same (regardless of whitespace).

Example: A table, originally created with the text editor, spans approximately 50 rows (some with trailing/leading whitespace). If someone else edits the table with the GUI editor, changes only one row and saves the page. The resulting diff with include the change but also include any rows where the whitespace has been removed by the editor. This is analogous to someone editing some source code and having their editor convert all tabs to spaces - the diff is incredibly unhelpful as any relevant changes are lost in the noise.

-- AGlenYoung 2008-10-22 17:05:00

Hmm, the normalization by the gui editor is done only once. If the result does not get further whitespaces added then the next edit should not pollute the diff result again. May be we should extend or replace the Remove trailing whitespace from each line function to the same normalization for the text editor than for the gui editor.

1.8_GUIEditorBreaksDiffsWithTables-fix.patch is file with patch against current release of MoinMoin. Problem is in FCKeditor, which removes alle whitespace from DOM nodes. This functionality was added in FCKeditor 2.3.3. Only latest branch (1.8) of MoinMoin is affected, as older releases (1.6.x and 1.7.x) contains FCKeditor 2.2, which doesn't have this problems. My fix removes functions which stripped whitespace from DOM, both from places where they was invoked and from actual place where they were defined (both in FCKeditor source files and compressed resulting ones, which are loaded by MoinMoin). I think that better solution would be to introduce new configuration variable to switch off whitespace stripping and pushing such change to FCKeditor itself. After that MoinMoin would be able to use such variable. Nonetheless my current solutions solves this problem. 1.8_GUIEditorBreaksDiffsWithTables-fix.patch -- ŁukaszCzyżykowski 2008-11-19 10:49:00

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/1.8_GUIEditorBreaksDiffsWithTables (last edited 2008-11-19 12:10:20 by ReimarBauer)