#5 Fix to table generation/add RTSP urls

closed-accepted
None
5
2001-04-19
2001-04-19
Rob Lanphier
No

Moin 0.8 incorrectly generates spurious </td>s which make tables invalid (and make export into
Excel not work)

While I'm at it, I've added RTSP to the supported protocols list. RTSP URLs will launch RealPlayer
under IE, but not Netscape.

Index: wiki.py

RCS file: /cvsroot/moin/MoinMoin/parser/wiki.py,v
retrieving revision 1.26
diff -c -r1.26 wiki.py
*** wiki.py 2001/04/04 20:57:06 1.26
--- wiki.py 2001/04/19 07:16:56
***************
*** 50,56 ****
(?P<smiley>\s(%(smiley)s)\s)
(?P<smileyA>^(%(smiley)s)\s)
(?P<ent>[<>&])""" % {
! 'url': 'http|https|ftp|nntp|news|mailto|telnet|wiki|file',
'url_guard': ('(^|(?<!\w))', '')[sys.version < "2"],
'punct': re.escape('''"'}]|:,.)?!'''),
'macronames': string.join(wikimacro.names, '|'),
--- 50,56 ----
(?P<smiley>\s(%(smiley)s)\s)
(?P<smileyA>^(%(smiley)s)\s)
(?P<ent>[<>&])""" % {
! 'url': 'http|https|ftp|nntp|news|mailto|telnet|wiki|file|rtsp',
'url_guard': ('(^|(?<!\w))', '')[sys.version < "2"],
'punct': re.escape('''"'}]|:,.)?!'''),
'macronames': string.join(wikimacro.names, '|'),
***************
*** 220,230 ****
--- 220,232 ----
"""Handle table cell separator."""
if self.in_table:
str = ''
+ cellterm = '</td>'

# start the table row?
if self.table_rowstart:
self.table_rowstart = 0
str = str + '<tr class="wiki">\n'
+ cellterm = ''

# check for adjacent cell markers
colspan = ''
***************
*** 232,238 ****
colspan = ' align="center" colspan="%d"' % (len(word)/2,)

# return the complete cell markup
! return '%s</td>\n<td class="wiki"%s>' % (str, colspan)
else:
return word

--- 234,240 ----
colspan = ' align="center" colspan="%d"' % (len(word)/2,)

# return the complete cell markup
! return '%s%s\n<td class="wiki"%s>' % (str, cellterm, colspan)
else:
return word

Discussion

    • assigned_to: nobody --> jhermann
     
    • status: open --> closed-accepted