Edgewall Software

Ticket #3263: wiki_timeline_event_diff_link-r3417.patch

File wiki_timeline_event_diff_link-r3417.patch, 1.9 KB (added by cboos, 3 years ago)

Updated patch, using Markup instead of Fragment.

  • trac/wiki/web_ui.py

     
    148148            href = format == 'rss' and req.abs_href or req.href 
    149149            db = self.env.get_db_cnx() 
    150150            cursor = db.cursor() 
    151             cursor.execute("SELECT time,name,comment,author " 
     151            cursor.execute("SELECT time,name,comment,author,version " 
    152152                           "FROM wiki WHERE time>=%s AND time<=%s", 
    153153                           (start, stop)) 
    154             for t,name,comment,author in cursor: 
     154            for t,name,comment,author,version in cursor: 
    155155                title = Markup('<em>%s</em> edited by %s', 
    156156                               wiki.format_page_name(name), author) 
    157157                if format == 'rss': 
     
    160160                else: 
    161161                    comment = wiki_to_oneliner(comment, self.env, db, 
    162162                                               shorten=True) 
     163                    if version > 1: 
     164                        diff_link = html.A('diff', href=href.wiki( 
     165                            name, action='diff', version=version, 
     166                            old_version=version-1)) 
     167                        comment = Markup('%s (%s)', comment, diff_link) 
    163168                yield 'wiki', href.wiki(name), title, t, author, comment 
    164169 
    165170            # Attachments 
  • trac/util/markup.py

     
    102102        as is. Escaping quotes is generally only required for strings that are 
    103103        to be used in attribute values. 
    104104        """ 
    105         if isinstance(text, cls): 
     105        if isinstance(text, (cls, Element)): 
    106106            return text 
    107107        text = unicode(text) 
    108108        if not text: