Edgewall Software

Changeset 11683


Ignore:
Timestamp:
Feb 11, 2013, 5:38:08 PM (13 years ago)
Author:
Christian Boos
Message:

1.0.2dev: Genshi 0.7 fix for wiki bracketed link .

Any page containing a <http://...> link produced a
global TracError:

Genshi UnicodeEncodeError error while rendering template (unknown template location)

The code was doing something like '...%s...' % Element() and the
Genshi builder Element contained a non-ascii character (ZWSP). In
Genshi 0.7, conversion to a str is now producing unicode, as the
default encoding parameter for Stream.render() is now None
(i.e. unicode).

Added a test case to catch this.

Location:
branches/1.0-stable/trac/wiki
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0-stable/trac/wiki/formatter.py

    r11490 r11683  
    576576        target = unquote_label(fullmatch.group('stgtbr'))
    577577        match = match[1:-1]
    578         return '&lt;%s&gt;' % \
     578        return u'&lt;%s&gt;' % \
    579579                self._make_link(ns, target, match, match, fullmatch)
    580580
  • branches/1.0-stable/trac/wiki/tests/wiki-tests.txt

    r11490 r11683  
    315315<p>
    316316nolink:&#34;&lt;blink&gt;&#34;
     317</p>
     318------------------------------
     319============================== Bracketed links
     320See <http://en.wikipedia.org/wiki/Mornington_Crescent_(game)>
     321------------------------------
     322<p>
     323See &lt;<a class="ext-link" href="http://en.wikipedia.org/wiki/Mornington_Crescent_(game)"><span class="icon"></span>http://en.wikipedia.org/wiki/Mornington_Crescent_(game)</a>&gt;
    317324</p>
    318325------------------------------
Note: See TracChangeset for help on using the changeset viewer.