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 1 | Cell 2 | Cell 3 |
Cell 4 | Cell 5 | Cell 6 |
in python2.5.2
Attachments (1)
Change History (9)
by , 16 years ago
comment:1 by , 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 , 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 , 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 , 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 , 16 years ago
Component: | ticket system → wiki system |
---|---|
Keywords: | table added |
Priority: | normal → high |
Oh, I see, it's happening for Trac environments where [ticket] preserve_newlines
is set (TracIni#ticket-section). Verified.
comment:6 by , 16 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
-
trac/wiki/formatter.py
854 854 if not line.startswith(' '): 855 855 self._tabstops = [] 856 856 857 if escape_newlines:858 line += ' [[BR]]'859 857 self.in_list_item = False 860 858 self.in_quote = False 861 859 # Throw a bunch of regexps on the problem … … 873 871 if self.in_table and line.strip()[0:2] != '||': 874 872 self.close_table() 875 873 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) 880 881 self.close_table_row() 881 882 882 883 self.close_table()
It seems to work fine and to not have adverse side-effects.
comment:8 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Applied in r7398. Thanks Maxwell for having persisted on this one, showing us the HTML did the trick ;-)
in trac0.11stable and trac0.11 tables in ticket has a extra column