Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#7461 closed defect (fixed)

Wikiformatting tables used in ticket has a extra column

Reported by: Maxwell Owned by: Christian Boos
Priority: high Milestone: 0.11.1
Component: wiki system Version: 0.11-stable
Severity: normal Keywords: table
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

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 (1)

pic.GIF (2.0 KB ) - added by Maxwell 16 years ago.
in trac0.11stable and trac0.11 tables in ticket has a extra column

Download all attachments as: .zip

Change History (9)

by Maxwell, 16 years ago

Attachment: pic.GIF added

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

comment:1 by Remy Blank <remy.blank@…>, 16 years ago

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?

comment:2 by Maxwell, 16 years ago

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>

comment:3 by Remy Blank <remy.blank@…>, 16 years ago

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.

comment:4 by Maxwell, 16 years ago

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

comment:5 by Christian Boos, 16 years ago

Component: ticket systemwiki system
Keywords: table added
Priority: normalhigh

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

comment:6 by Christian Boos, 16 years ago

Owner: set to Christian Boos
Status: newassigned
  • 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.

comment:7 by Maxwell, 16 years ago

In my trac instance it works fine.

comment:8 by Christian Boos, 16 years ago

Resolution: fixed
Status: assignedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.