GUI-Editor Shift+Enter breaks tables

Pressing Shift+Enter Inside GUI editor inserts a new-line char, which may cause the table to be broken.

Steps to reproduce

  1. Edit a page in GUI Mode.
  2. Inside a cell, type aaa<ENTER>aaa<SHIFT+ENTER>aaa

  3. Press save.

The table isn't rendered properly because that moin wiki code is broken. see below.

Example

Content typed:

Sample result

||aaa<ENTER>aaa<SHIFT+ENTER>aaa||aaa aaa aaa ||

aaa<ENTER>aaa<ENTER>aaa

aaa aaa aaa

aaa<SHIFT+ENTER>aaa<SHIFT+ENTER>aaa

aaa
aaa
aaa

Component selection

Details

MoinMoin Version

1.8.2

OS and Version

Debian Sid

Python Version

2.5

Server Setup

Apache/CGI

Server Details

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

English

Workaround

Fix the code manually (in raw text mode), by removing the line feed.

Discussion

Here's a patch: guieditor_preserve_br.diff, which also works in conjunction with MoinMoinBugs/GuiEditorDontAllowBrInTables

   1 --- a/MoinMoin/converter/text_html_text_moin_wiki.py    2009-03-01 21:08:05.000000000 +0100
   2 +++ b/MoinMoin/converter/text_html_text_moin_wiki.py    2009-03-01 21:08:08.000000000 +0100
   3 @@ -568,8 +568,10 @@
   4              #    self.text.append("\n")
   5 
   6      def process_br(self, node):
   7 -        self.text.append(self.new_line) # without this, std multi-line text below some heading misses a whitespace
   8 -                                        # when it gets merged to float text, like word word wordword word word
   9 +        self.text.append('<<BR>>') # without this, std multi-line text below some heading misses a whitespace
  10 +                                   # when it gets merged to float text, like word word wordword word word
  11 +                                   # note: Do not print a new-line, since it would break moinmoin tables.
  12 +                                   #       regression test: type "aaa<ENTER>aaa<SHIFT+ENTER>aaa"
  13 
  14      def process_heading(self, node):
  15          text = self.node_list_text_only(node.childNodes).strip()

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/GuiEditorShiftEnterBreaksTables (last edited 2009-03-01 21:48:39 by FranklinPiat)