Edgewall Software

Ticket #7461 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

Wikiformatting tables used in ticket has a extra column

Reported by: Maxwell Owned by: cboos
Priority: high Milestone: 0.11.1
Component: wiki system Version: 0.11-stable
Severity: normal Keywords: table
Cc:

Description

||Cell 1||Cell 2||Cell 3||
||Cell 4||Cell 5||Cell 6||
Cell 1Cell 2Cell 3
Cell 4Cell 5Cell 6

in python2.5.2

Attachments

pic.GIF (2.0 kB) - added by Maxwell 2 months ago.
in trac0.11stable and trac0.11 tables in ticket has a extra column

Change History

Changed 2 months ago by Maxwell

in trac0.11stable and trac0.11 tables in ticket has a extra column

Changed 2 months ago by Remy Blank <remy.blank@…>

This is a duplicate of #7327, which was closed as worksforme.

Could you please provide some more information:

  • Installed Trac plugins
  • Browser version (and plugins if applicable)
  • Operating system

Could you also please attach the HTML source of the page that you used to make the screenshot above?

Changed 2 months ago by Maxwell

Plugin: AccountManagerPlugin? export from trunk(version tracaccountmanager 0.2.1dev )
Browser: IE6, firefox3.0.1, IE7
OS: WinXP SP2, win2003server SP2
DB: sqlite(follow in trac0.11)

The HTML source

<div class="searchable">
                <table class="wiki">
<tr><td>Cell 1</td><td>Cell 2</td><td>Cell 3</td><td> <br />
</td></tr><tr><td>Cell 4</td><td>Cell 5</td><td>Cell 6</td><td> <br />
</td></tr></table>

              </div>

Changed 2 months ago by Remy Blank <remy.blank@…>

Thanks for the info, but I still can't reproduce the problem, even with AccountManagerPlugin installed. Is the table in the description of this ticket formatted correctly for you, or does it show the extra column?

Could you please create a wiki page on your Trac instance that shows the problem, download it as plain text (the link is at the bottom of the page) and attach it to this ticket?

The extra column contains a space and a <br /> tag. The only location where this tag is generated in code is in trac/wiki/formatter.py, and only in response to a [[BR]] macro.

Changed 2 months ago by Maxwell

This problem is not exists in wiki page. The table in the description of this ticket formatted correctly for me.

In my trac instance if I use this formatting, the table formatted correctly.

||Cell 1||Cell 2||Cell 3
||Cell 4||Cell 5||Cell 6

Changed 2 months ago by cboos

  • keywords table added
  • priority changed from normal to high
  • component changed from ticket system to wiki system

Oh, I see, it's happening for Trac environments where [ticket] preserve_newlines is set (TracIni#ticket-section). Verified.

Changed 2 months ago by cboos

  • owner set to cboos
  • status changed from new to assigned
  • trac/wiki/formatter.py

     
    854854            if not line.startswith(' '): 
    855855                self._tabstops = [] 
    856856 
    857             if escape_newlines: 
    858                 line += ' [[BR]]' 
    859857            self.in_list_item = False 
    860858            self.in_quote = False 
    861859            # Throw a bunch of regexps on the problem 
     
    873871            if self.in_table and line.strip()[0:2] != '||': 
    874872                self.close_table() 
    875873 
    876             if len(result) and not self.in_list_item and not self.in_def_list \ 
    877                     and not self.in_table: 
    878                 self.open_paragraph() 
    879             self.out.write(result + os.linesep) 
     874            sep = os.linesep 
     875            if not(self.in_list_item or self.in_def_list or self.in_table): 
     876                if len(result): 
     877                    self.open_paragraph() 
     878                if escape_newlines: 
     879                    sep = '<br />' + sep 
     880            self.out.write(result + sep) 
    880881            self.close_table_row() 
    881882 
    882883        self.close_table() 

It seems to work fine and to not have adverse side-effects.

Changed 2 months ago by Maxwell

In my trac instance it works fine.

Changed 2 months ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed

Applied in r7398. Thanks Maxwell for having persisted on this one, showing us the HTML did the trick ;-)

Add/Change #7461 (Wikiformatting tables used in ticket has a extra column)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.