Changeset 8699
- Timestamp:
- Oct 26, 2009, 6:35:24 PM (14 years ago)
- Location:
- trunk/trac
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/trac/htdocs/css/trac.css
r8697 r8699 348 348 } 349 349 table.wiki td { border: 1px solid #ccc; padding: .1em .25em; } 350 table.wiki th { border: 2px solid #bbb; padding: .1em .8em; } 350 351 351 352 .wikitoolbar { -
trunk/trac/wiki/formatter.py
r8698 r8699 747 747 self.open_table() 748 748 self.open_table_row() 749 colspan = len(match)/2 749 numpipes = len(match) 750 cell = 'td' 751 if match[0] == '=': 752 numpipes -= 1 753 if match[-1] == '=': 754 numpipes -= 1 755 cell = 'th' 756 colspan = numpipes/2 750 757 if colspan > 1: 751 td = '< td colspan="%d">' % int(colspan)752 else: 753 td = '< td>'758 td = '<%s colspan="%d">' % (cell, int(colspan)) 759 else: 760 td = '<%s>' % cell 754 761 if self.in_table_cell: 755 return '</td>'+td 756 else: 757 self.in_table_cell = 1 758 return td 762 td = '</%s>' % self.in_table_cell + td 763 self.in_table_cell = cell 764 return td 759 765 760 766 def open_table(self): … … 776 782 self.in_table_row = 0 777 783 if self.in_table_cell: 778 self.in_table_cell = 0 779 self.out.write('</td>') 780 784 self.out.write('</%s>' % self.in_table_cell) 785 self.in_table_cell = '' 781 786 self.out.write('</tr>') 782 787 … … 882 887 self.in_def_list = 0 883 888 self.in_table_row = 0 884 self.in_table_cell = 0889 self.in_table_cell = '' 885 890 self.paragraph_open = 0 886 891 -
trunk/trac/wiki/parser.py
r8698 r8699 111 111 r"(?P<indent>^(?P<idepth>\s+)(?=\S))", 112 112 # || table || 113 r"(?P<last_table_cell> \|\|\s*$)",114 r"(?P<table_cell>!? (?:\|\|)+)"]113 r"(?P<last_table_cell>=?\|\|\s*$)", 114 r"(?P<table_cell>!?=?(?:\|\|)+=?)"] 115 115 116 116 _processor_re = re.compile('#\!([\w+-][\w+-/]*)') -
trunk/trac/wiki/tests/wiki-tests.txt
r8698 r8699 1253 1253 |||||| end || 1254 1254 ---- 1255 ============================== Table headings (plus colspan) 1256 ||= this is a header =||||= another header =|| not a header || 1257 ||= also a header =|| some non- || header cells ||= header =|| 1258 ------------------------------ 1259 <table class="wiki"> 1260 <tr><th> this is a header </th><th colspan="2"> another header </th><td> not a header 1261 </td></tr><tr><th> also a header </th><td> some non- </td><td> header cells </td><th> header 1262 </th></tr></table> 1263 ------------------------------ 1255 1264 ============================== Indented tables, multiple columns 1256 1265 || a || b ||
Note:
See TracChangeset
for help on using the changeset viewer.