Edgewall Software

ChristianBoos: wiki2x_in_templates.diff

File wiki2x_in_templates.diff, 55.5 KB (added by cboos, 5 years ago)

move most of the wiki_to_html and wiki_to_oneliner calls in the Genshi templates

  • trac/attachment.py

     
    3434from trac.web import HTTPBadRequest, IRequestHandler 
    3535from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 
    3636from trac.wiki.api import IWikiSyntaxProvider 
    37 from trac.wiki.formatter import wiki_to_html, wiki_to_oneliner 
    3837 
    3938 
    4039class InvalidAttachment(TracError): 
     
    254253        return fd 
    255254 
    256255 
    257 # Templating utilities 
    258  
    259 def attachments_data(env, req, db, parent_type, parent_id): 
    260     return [attachment_data(env, req, db, attachment) for attachment 
    261             in Attachment.select(env, parent_type, parent_id, db)] 
    262      
    263 def attachment_data(env, req, db, attachment): 
    264     # FIXME: pretty close to the attachment itself... so pass directly 
    265     # the attachment 
    266     if not db: 
    267         db = env.get_db_cnx() 
    268     description = wiki_to_oneliner(attachment.description, env, db) 
    269     return { 
    270         'filename': attachment.filename, 
    271         'description': Markup(description.strip()), 
    272         'author': attachment.author, 
    273         'ipnr': attachment.ipnr, 
    274         'size': attachment.size, 
    275         'date': attachment.time, 
    276         'href': attachment.href(req) 
    277     } 
    278  
    279  
    280256class AttachmentModule(Component): 
    281257 
    282258    implements(IEnvironmentSetupParticipant, IRequestHandler, 
     
    363339                data = { 
    364340                    'mode': 'list', 
    365341                    'parent': parent_data(parent_type, last_segment), 
    366                     'attachments': attachments_data(self.env, req, None, 
    367                                                     parent_type, last_segment), 
     342                    'attachments': Attachment.select(self.env, 
     343                                                     parent_type, last_segment) 
    368344                    } 
    369345                return 'attachment.html', data, None 
    370346            if not last_segment: 
     
    426402                self.get_history(start, stop, type): 
    427403            title = html(html.EM(os.path.basename(filename)), 
    428404                         ' attached to ', display(id)) 
    429             if format == 'rss': 
    430                 descr = wiki_to_html(descr or '--', self.env, req, db, 
    431                                      absurls=True) 
    432                 href = req.abs_href 
    433             else: 
    434                 descr = wiki_to_oneliner(descr, self.env, db, shorten=True) 
    435                 title += Markup(' by %s', author) 
    436                 href = req.href 
    437             yield('attachment', href.attachment(type, id, filename), title, 
     405            yield('attachment', req.href.attachment(type, id, filename), title, 
    438406                  time, author, descr) 
    439407 
    440408    # Internal methods 
     
    533501 
    534502        req.check_modified(attachment.time) 
    535503 
    536         # Render HTML view 
    537         att_data = attachment_data(self.env, req, None, attachment) 
    538         # Override the 'oneliner' 
    539         att_data['description'] = wiki_to_html(attachment.description, 
    540                                                self.env, req) 
    541          
    542504        data = {'mode': 'view', 'title': attachment.title, 
    543                 'attachment': att_data} 
     505                'attachment': attachment} 
    544506     
    545507        perm_map = {'ticket': 'TICKET_ADMIN', 'wiki': 'WIKI_DELETE'} 
    546508        if req.perm.has_permission(perm_map[attachment.parent_type]): 
  • trac/ticket/web_ui.py

     
    1919from StringIO import StringIO 
    2020import time 
    2121 
    22 from trac.attachment import attachments_data, Attachment, AttachmentModule 
     22from trac.attachment import Attachment, AttachmentModule 
    2323from trac.config import BoolOption, Option 
    2424from trac.core import * 
    2525from trac.ticket import Milestone, Ticket, TicketSystem, ITicketManipulator 
     
    3131from trac.web import IRequestHandler 
    3232from trac.web.chrome import add_link, add_stylesheet, INavigationContributor, \ 
    3333                            Chrome 
    34 from trac.wiki import wiki_to_html, wiki_to_oneliner 
    3534from trac.mimeview.api import Mimeview, IContentConverter 
     35from trac.wiki import wiki_to_html, wiki_to_oneliner 
    3636 
    3737 
    3838class InvalidTicket(TracError): 
     
    107107        ticket.values['reporter'] = get_reporter_id(req, 'reporter') 
    108108        data['ticket'] = ticket 
    109109 
    110         if 'description' in ticket.values: 
    111             description = wiki_to_html(ticket['description'], self.env, req, db) 
    112             data['preview'] = description 
    113  
    114110        field_names = [field['name'] for field in ticket.fields 
    115111                       if not field.get('custom')] 
    116112        if 'owner' in field_names: 
     
    265261                comment = req.args.get('comment') 
    266262                if comment: 
    267263                    data['comment'] = comment 
    268                     # Wiki format a preview of comment 
    269                     data['preview'] = wiki_to_html(comment, self.env, req, db) 
     264                    data['preview'] = True 
    270265        else: 
    271266            data['reassign_owner'] = req.authname 
    272267            # Store a timestamp in order to detect "mid air collisions" 
     
    445440            change_summary = {} 
    446441            # wikify comment 
    447442            if 'comment' in change: 
    448                 comment = change['comment'] 
    449                 change['comment'] = unicode(wiki_to_html( 
    450                     comment, self.env, req, db, absurls=True)) 
    451443                change_summary['added'] = ['comment'] 
    452444            for field, values in change['fields'].iteritems(): 
    453445                if field == 'description': 
     
    462454            change['title'] = '; '.join(['%s %s' % (', '.join(v), k) for k, v \ 
    463455                                         in change_summary.iteritems()]) 
    464456 
    465         data = { 
    466             'id': ticket.id, 
    467             'description': wiki_to_html(ticket['description'], self.env, req, 
    468                                         db, absurls=True), 
    469             'changes': changes, 
    470             } 
     457        data = {'ticket': ticket, 'changes': changes} 
    471458         
    472459        template = Chrome(self.env).load_template('ticket.rss', req, data) 
    473460        return template.generate(**data).render('xml'), 'application/rss+xml' 
     
    558545            data['fields'].append(field) 
    559546 
    560547        data['reporter_id'] = reporter_id 
    561         data['description'] = wiki_to_html(ticket['description'], self.env, req, 
    562                                            db) 
    563548 
    564549        # FIXME: get rid of this once datetime branch is merged 
    565550        data['opened'] = ticket.time_created 
     
    587572            comment = '' 
    588573            if 'comment' in change: 
    589574                comment = change['comment'] 
    590                 change['comment'] = wiki_to_html(comment, self.env, req, db) 
    591575            if change['permanent']: 
    592576                cnum = change['cnum'] 
    593577                # keep track of replies threading 
     
    611595 
    612596        # -- Ticket Attachments 
    613597 
    614         data['attachments'] = attachments_data(self.env, req, db, 'ticket', 
    615                                                ticket.id) 
     598        data['attachments'] = Attachment.select(self.env, 'ticket', ticket.id, 
     599                                                db) 
    616600        if req.perm.has_permission('TICKET_APPEND'): 
    617601            data['attach_href'] = req.href.attachment('ticket', ticket.id) 
    618602 
  • trac/ticket/report.py

     
    2727from trac.util.html import html 
    2828from trac.web.api import IRequestHandler, RequestDone 
    2929from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 
    30 from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter 
     30from trac.wiki import IWikiSyntaxProvider, Formatter 
    3131 
    3232 
    3333class ReportModule(Component): 
     
    232232            title = '{%i} %s' % (id, title) 
    233233         
    234234        data = {'action': 'view', 'title': title, 
    235                 'report': 
    236                 {'id': id, 'title': title, 
    237                  'description': wiki_to_html(description, self.env, req, db, 
    238                                              absurls=(format == 'rss')), 
    239                  'can': perms}} 
    240  
     235                'report': {'id': id, 'title': title, 
     236                           'description': description, 'can': perms}} 
    241237        try: 
    242238            cols, results = self.execute_report(req, db, id, sql, args) 
    243239        except Exception, e: 
     
    318314                        row['id'] = value 
    319315                    # Special casing based on column name 
    320316                    col = col.strip('_') 
    321                     if col == 'description': 
    322                         cell['parsed'] = wiki_to_html(value, self.env, req, db, 
    323                                                       absurls=(format == 'rss')) 
    324                     elif col == 'reporter': 
     317                    if col == 'reporter': 
    325318                        if '@' in value: 
    326319                            cell['author'] = value 
    327320                        elif value in email_map: 
  • trac/ticket/roadmap.py

     
    2929from trac.Timeline import ITimelineEventProvider 
    3030from trac.web import IRequestHandler 
    3131from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 
    32 from trac.wiki import wiki_to_html, wiki_to_oneliner, IWikiSyntaxProvider 
     32from trac.wiki import IWikiSyntaxProvider 
    3333 
    3434 
    3535def get_tickets_for_milestone(env, db, milestone, field='component'): 
     
    8787    } 
    8888 
    8989def milestone_to_hdf(env, db, req, milestone): 
     90    ### FIXME: should use the Milestone object directly 
    9091    safe_name = None 
    9192    if milestone.exists: 
    9293        safe_name = milestone.name.replace('/', '%2F') 
    9394    hdf = {'name': milestone.name, 'exists': milestone.exists, 
    9495           'href': req.href.milestone(safe_name)} 
    9596    if milestone.description: 
    96         hdf['description_source'] = milestone.description 
    97         hdf['description'] = wiki_to_html(milestone.description, env, req, db) 
     97        hdf['description'] = milestone.description 
    9898    if milestone.due: 
    9999        hdf['due'] = milestone.due 
    100100        hdf['due_date'] = format_date(milestone.due) 
     
    317317                           (start, stop,)) 
    318318            for completed, name, description in cursor: 
    319319                title = Markup('Milestone <em>%s</em> completed', name) 
    320                 if format == 'rss': 
    321                     href = req.abs_href.milestone(name) 
    322                     message = wiki_to_html(description, self.env, req, db, 
    323                                            absurls=True) 
    324                 else: 
    325                     href = req.href.milestone(name) 
    326                     message = wiki_to_oneliner(description, self.env, db, 
    327                                                shorten=True) 
    328                 yield 'milestone', href, title, completed, None, message or '--' 
     320                yield 'milestone', href, title, completed, None, description 
    329321 
    330322    # IRequestHandler methods 
    331323 
  • trac/ticket/query.py

     
    2929from trac.web.chrome import add_link, add_script, add_stylesheet, \ 
    3030                            INavigationContributor, Chrome 
    3131from trac.wiki.api import IWikiSyntaxProvider, parse_args 
    32 from trac.wiki.formatter import wiki_to_html, wiki_to_oneliner 
    3332from trac.wiki.macros import WikiMacroBase # TODO: should be moved in .api 
    3433from trac.mimeview.api import Mimeview, IContentConverter 
    3534 
     
    405404                    groups.setdefault(value, []).append(ticket) 
    406405                    if not groupsequence or groupsequence[-1] != value: 
    407406                        groupsequence.append(value) 
    408                 if field == 'time': 
    409                     ticket[field] = value 
    410                 elif field == 'description': 
    411                     ticket[field] = \ 
    412                                   wiki_to_html(value or '', self.env, req, db) 
    413                 else: 
    414                     ticket[field] = value 
     407                ticket[field] = value 
    415408        groupsequence = [(value, groups[value]) for value in groupsequence] 
    416409 
    417410        return {'query': self, 
     
    639632        for result in results: 
    640633            if result['reporter'].find('@') == -1: 
    641634                result['reporter'] = '' 
    642             if result['description']: 
    643                 result['description'] = wiki_to_html(result['description'], 
    644                                                      self.env, req, db, 
    645                                                      absurls=True) 
    646635        query_href = req.abs_href.query(group=query.group, 
    647636                                        groupdesc=query.groupdesc and 1 or None, 
    648637                                        verbose=query.verbose and 1 or None, 
  • trac/versioncontrol/web_ui/util.py

     
    2424from trac.util.html import escape, html, Markup 
    2525from trac.util.text import shorten_line 
    2626from trac.versioncontrol.api import NoSuchNode, NoSuchChangeset 
    27 from trac.wiki import wiki_to_html, wiki_to_oneliner 
    2827 
    2928__all__ = ['get_changes', 'get_path_links', 'get_path_rev_line', 
    3029           'get_existing_node', 'render_node_property'] 
     
    4140 
    4241        wiki_format = env.config['changeset'].getbool('wiki_format_messages') 
    4342        message = changeset.message or '--' 
    44         absurls = (format == 'rss') 
    45         if wiki_format: 
    46             shortlog = wiki_to_oneliner(message, env, db, 
    47                                         shorten=True, absurls=absurls) 
    48         else: 
     43        if not wiki_format: 
    4944            shortlog = Markup.escape(shorten_line(message)) 
     45        else: 
     46            shortlog = message 
    5047 
    5148        if full: 
    52             if wiki_format: 
    53                 message = wiki_to_html(message, env, req, db, 
    54                                        absurls=absurls, escape_newlines=True) 
    55             else: 
     49            if not wiki_format: 
    5650                message = html.PRE(message) 
    5751        else: 
    5852            message = shortlog 
    5953 
    60         if format == 'rss': 
    61             if isinstance(shortlog, Markup): 
    62                 shortlog = u' '.join(shortlog.striptags().splitlines()) 
    63             message = unicode(message) 
    64  
    6554        changes[rev] = { 
    6655            'date_seconds': changeset.date, 
    6756            'date': format_datetime(changeset.date), 
    6857            'age': pretty_timedelta(changeset.date), 
    6958            'author': changeset.author or 'anonymous', 
    70             'message': message, 'shortlog': shortlog, 
     59            'message': message, 
     60            'shortlog': shortlog, 
    7161        } 
    7262    return changes 
    7363 
  • trac/versioncontrol/web_ui/changeset.py

     
    3939from trac.versioncontrol.web_ui.util import render_node_property 
    4040from trac.web import IRequestHandler, RequestDone 
    4141from trac.web.chrome import INavigationContributor, add_link, add_stylesheet 
    42 from trac.wiki import wiki_to_html, wiki_to_oneliner, IWikiSyntaxProvider, \ 
    43                       Formatter 
     42from trac.wiki import IWikiSyntaxProvider, Formatter 
    4443 
    4544 
    4645class ChangesetModule(Component): 
     
    202201        if chgset: 
    203202            chgset = repos.get_changeset(new) 
    204203            message = chgset.message or '--' 
    205             if self.wiki_format_messages: 
    206                 message = wiki_to_html(message, self.env, req, 
    207                                               escape_newlines=True) 
    208             else: 
     204            if not self.wiki_format_messages: 
    209205                message = html.PRE(message) 
    210206            req.check_modified(chgset.date, [ 
    211207                style, ''.join(options), repos.name, 
     
    293289            title = _changeset_title(rev) 
    294290            properties = [] 
    295291            for name, value, wikiflag, htmlclass in chgset.get_properties(): 
    296                 if wikiflag: 
    297                     value = wiki_to_html(value or '', self.env, req) 
    298292                properties.append({'name': name, 'value': value, 
    299                                    'htmlclass': htmlclass}) 
     293                                   'htmlclass': htmlclass, 
     294                                   'wiki_formatting': wikiflag}) 
    300295 
    301296            data['changeset'] = { 
    302297                'revision': chgset.rev, 
     
    619614            repos = self.env.get_repository(req.authname) 
    620615            for chgset in repos.get_changesets(start, stop): 
    621616                message = chgset.message or '--' 
    622                 if wiki_format: 
    623                     shortlog = wiki_to_oneliner(message, self.env, db, 
    624                                                 shorten=True) 
    625                 else: 
     617                if not wiki_format: 
    626618                    shortlog = shorten_line(message) 
    627619 
    628620                if format == 'rss': 
    629621                    title = Markup('Changeset [%s]: %s', chgset.rev, shortlog) 
    630622                    href = req.abs_href.changeset(chgset.rev) 
    631                     if wiki_format: 
    632                         message = wiki_to_html(message, self.env, req, db, 
    633                                                absurls=True) 
    634                     else: 
     623                    if not wiki_format: 
    635624                        message = html.PRE(message) 
    636625                else: 
    637626                    title = Markup('Changeset <em>[%s]</em> by %s', chgset.rev, 
     
    639628                    href = req.href.changeset(chgset.rev) 
    640629 
    641630                    if wiki_format: 
     631                        # FIXME: 
    642632                        if self.timeline_long_messages: 
    643                             message = wiki_to_html(message, self.env, req, db, 
    644                                                    absurls=True) 
    645                         else: 
    646                             message = wiki_to_oneliner(message, self.env, db, 
    647                                                        shorten=True) 
     633                            pass 
     634                        # FIXME: should set the shorten flag on the event, 
     635                        #        see timeline.html 
    648636                    else: 
    649                         message = shortlog 
     637                        message = Markup.escape(shortlog) 
    650638 
    651639                if show_files and req.perm.has_permission('BROWSER_VIEW'): 
    652640                    files = [] 
  • trac/versioncontrol/web_ui/browser.py

     
    2727from trac.util import sorted, embedded_numbers 
    2828from trac.util.datefmt import http_date 
    2929from trac.util.html import escape, html, Markup 
    30 from trac.web import IRequestHandler, RequestDone 
    31 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 
    32 from trac.wiki import wiki_to_html, IWikiSyntaxProvider 
    3330from trac.versioncontrol.api import NoSuchChangeset 
    3431from trac.versioncontrol.web_ui.util import * 
     32from trac.web.api import IRequestHandler, RequestDone 
     33from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 
     34from trac.wiki.api import IWikiSyntaxProvider 
    3535 
    3636 
    3737CHUNK_SIZE = 4096 
     
    204204            changeset = repos.get_changeset(node.rev) 
    205205 
    206206            message = changeset.message or '--' 
    207             if self.config['changeset'].getbool('wiki_format_messages'): 
    208                 message = wiki_to_html(message, self.env, req, 
    209                                        escape_newlines=True) 
    210             else: 
     207            if not self.config['changeset'].getbool('wiki_format_messages'): 
    211208                message = html.PRE(message) 
    212209 
    213210            # add ''Plain Text'' alternate link if needed 
  • trac/About.py

     
    9595 
    9696    def _render_plugins(self, req): 
    9797        try: 
    98             from trac.wiki.formatter import wiki_to_html 
    9998            import inspect 
    10099            def getdoc(obj): 
    101                 return wiki_to_html(inspect.getdoc(obj), self.env, req) 
     100                return inspect.getdoc(obj) 
    102101        except: 
    103102            def getdoc(obj): 
    104103                return obj.__doc__ 
     
    112111                continue 
    113112            plugin = {'name': component.__name__} 
    114113            if component.__doc__: 
    115                 plugin['description'] = Markup(getdoc(component)) 
     114                plugin['description'] = getdoc(component) 
    116115 
    117116            module = sys.modules[component.__module__] 
    118117            plugin['module'] = module.__name__ 
     
    128127                               'interface': xtnpt.interface.__name__, 
    129128                               'module': xtnpt.interface.__module__}) 
    130129                if xtnpt.interface.__doc__: 
    131                     xtnpts[-1]['description'] = Markup(getdoc(xtnpt.interface)) 
     130                    xtnpts[-1]['description'] = getdoc(xtnpt.interface) 
    132131                extensions = [] 
    133132                for extension in ComponentMeta._registry.get(xtnpt.interface, []): 
    134133                    if self.env.is_component_enabled(extension): 
  • trac/wiki/web_ui.py

     
    2020import re 
    2121import StringIO 
    2222 
    23 from trac.attachment import attachments_data, Attachment, AttachmentModule 
     23from trac.attachment import Attachment, AttachmentModule 
    2424from trac.core import * 
    2525from trac.perm import IPermissionRequestor 
    2626from trac.Search import ISearchSource, search_to_sql, shorten_result 
     
    3333from trac.web import HTTPNotFound, IRequestHandler 
    3434from trac.wiki.api import IWikiPageManipulator, WikiSystem 
    3535from trac.wiki.model import WikiPage 
    36 from trac.wiki.formatter import wiki_to_html, wiki_to_oneliner 
    3736from trac.mimeview.api import Mimeview, IContentConverter 
    3837 
    3938 
     
    243242            if version == new_version: 
    244243                date = t 
    245244                author = a or 'anonymous' 
    246                 comment = wiki_to_html(c or '--', self.env, req, db) 
     245                comment = c 
    247246                ipnr = i or '' 
    248247            else: 
    249248                if version < new_version: 
     
    335334            'edit_rows': editrows, 
    336335            'scroll_bar_pos': req.args.get('scroll_bar_pos', '') 
    337336        }) 
    338         if action == 'preview': 
    339             data.update({ 
    340             'page_html': wiki_to_html(page.text, self.env, req, db), 
    341             'comment_html': wiki_to_oneliner(comment, self.env, db) 
    342             }) 
    343337        return 'wiki_edit.html', data, None 
    344338 
    345339    def _render_history(self, req, db, page): 
     
    361355                'version': version, 
    362356                'date': date, 
    363357                'author': author, 
    364                 'comment': wiki_to_oneliner(comment or '', self.env, db), 
     358                'comment': comment, 
    365359                'ipnr': ipnr 
    366360            }) 
    367361        data['history'] = history 
     
    384378        if page.name == 'WikiStart': 
    385379            data['title'] = '' 
    386380 
    387         page_html = comment_html = attach_href = '' 
     381        attach_href = '' 
    388382        latest_page = WikiPage(self.env, page.name) 
    389383 
    390         if page.exists: 
    391             page_html = wiki_to_html(page.text, self.env, req, db) 
    392             if version: 
    393                 comment_html = wiki_to_oneliner(page.comment or '--', 
    394                                                 self.env, db) 
    395         else: 
     384        if not page.exists: 
    396385            if not req.perm.has_permission('WIKI_CREATE'): 
    397386                raise HTTPNotFound('Page %s not found', page.name) 
    398             page_html = html.P('Describe "%s" here' % data['page_name']) 
     387            page.text = 'Describe "`%s`" here' % data['page_name'] 
    399388 
    400389        # Show attachments 
    401         attachments = attachments_data(self.env, req, db, 'wiki', page.name) 
     390        attachments = Attachment.select(self.env, 'wiki', page.name, db) 
    402391        if req.perm.has_permission('WIKI_MODIFY'): 
    403392            attach_href = req.href.attachment('wiki', page.name) 
    404393 
    405394        data.update({'action': 'view', 
    406                      'page_html': page_html, 
    407                      'comment_html': comment_html, 
     395                     'version': version, 
    408396                     'latest_version': latest_page.version, 
    409397                     'attachments': attachments, 
    410398                     'attach_href': attach_href, 
     
    432420            for t,name,comment,author,version in cursor: 
    433421                title = Markup('<em>%s</em> edited by %s', 
    434422                               wiki.format_page_name(name), author) 
    435                 diff_link = html.A('diff', href=href.wiki(name, action='diff', 
    436                                                           version=version)) 
    437                 if format == 'rss': 
    438                     comment = wiki_to_html(comment or '--', self.env, req, db, 
    439                                            absurls=True) 
    440                 else: 
    441                     comment = wiki_to_oneliner(comment, self.env, db, 
    442                                                shorten=True) 
    443423                if version > 1: 
    444                     comment = html(comment, ' (', diff_link, ')') 
    445                 yield 'wiki', href.wiki(name), title, t, author, comment 
     424                    link = href.wiki(name, action='diff', version=version) 
     425                else: 
     426                    link = href.wiki(name) 
     427                yield 'wiki', link, title, t, author, comment 
    446428 
    447429            # Attachments 
    448430            def display(id): 
  • trac/wiki/tests/formatter.py

     
    129129 
    130130class OneLinerTestCase(WikiTestCase): 
    131131    def formatter(self): 
    132         return OneLinerFormatter(self.env) # TODO: self.req 
     132        return OneLinerFormatter(self.env, self.req) 
    133133 
    134134 
    135135def suite(data=None, setup=None, file=__file__): 
  • trac/wiki/formatter.py

     
    861861    """ 
    862862    flavor = 'oneliner' 
    863863 
    864     def __init__(self, env, absurls=False, db=None): 
    865         Formatter.__init__(self, env, None, absurls, db) 
     864    def __init__(self, env, req, absurls=False, db=None): 
     865        Formatter.__init__(self, env, req, absurls, db) 
    866866 
    867867    # Override a few formatters to disable some wiki syntax in "oneliner"-mode 
    868868    def _list_formatter(self, match, fullmatch): return match 
     
    10091009    if not wikitext: 
    10101010        return Markup() 
    10111011    out = StringIO() 
    1012     OneLinerFormatter(env, absurls, db).format(wikitext, out, shorten) 
     1012    OneLinerFormatter(env, None, absurls, db).format(wikitext, out, shorten) 
    10131013    return Markup(out.getvalue()) 
    10141014 
    10151015def wiki_to_outline(wikitext, env, db=None, 
  • trac/web/chrome.py

     
    1717import __builtin__ 
    1818import os 
    1919import re 
     20from StringIO import StringIO 
    2021 
    2122from genshi import Markup 
    22 from genshi.builder import tag 
     23from genshi.builder import tag, Fragment 
    2324from genshi.output import DocType 
    2425from genshi.template import TemplateLoader, MarkupTemplate, TextTemplate 
    2526 
     
    3233                              format_time, http_date 
    3334from trac.web.api import IRequestHandler, HTTPNotFound 
    3435from trac.web.href import Href 
    35 from trac.wiki import IWikiSyntaxProvider 
     36from trac.wiki.api import IWikiSyntaxProvider 
     37from trac.wiki.formatter import Formatter, OneLinerFormatter 
    3638 
    3739def add_link(req, rel, href, title=None, mimetype=None, classname=None): 
    3840    """Add a link to the HDF data set that will be inserted as <link> element in 
     
    419421        data['format_date'] = format_date 
    420422        data['format_time'] = format_time 
    421423        data['http_date'] = http_date 
    422          
     424 
     425        def wiki_to_html(text, absurls=False, escape_newlines=False): 
     426            if not text: 
     427                return Markup() 
     428            if isinstance(text, (Fragment, Markup)): 
     429                return text 
     430            out = StringIO() 
     431            Formatter(self.env, req, absurls).format(text, out, 
     432                                                     escape_newlines) 
     433            return Markup(out.getvalue()) 
     434             
     435        def wiki_to_oneliner(text, absurls=False, shorten=False): 
     436            if not text: 
     437                return Markup() 
     438            if isinstance(text, (Fragment, Markup)): 
     439                return text 
     440            out = StringIO() 
     441            OneLinerFormatter(self.env, req, absurls).format(text, out, 
     442                                                             shorten) 
     443            return Markup(out.getvalue()) 
     444 
     445        data['wiki_to_html'] = wiki_to_html 
     446        data['wiki_to_oneliner'] = wiki_to_oneliner 
     447 
    423448        ## debugging tools 
    424449        from pprint import pformat 
    425450        data['pprint'] = pformat 
  • templates/ticket_view.html

     
    6969                  (last modified by ${description_author}) 
    7070                </span> 
    7171              </h3> 
    72               ${description} 
     72              ${wiki_to_html(ticket.description)} 
    7373            </div> 
    7474          </form> 
    7575        </div> 
     
    122122                    </py:choose> 
    123123                  </li> 
    124124                </ul> 
    125                 <div py:if="change.comment" class="comment">${change.comment}</div> 
     125                <div py:if="change.comment" class="comment">${wiki_to_html(change.comment)}</div> 
    126126              </div> 
    127127            </form> 
    128128          </div> 
     
    149149            </fieldset> 
    150150            <fieldset py:if="preview" id="preview"> 
    151151              <legend>Comment Preview</legend> 
    152               ${preview} 
     152              ${wiki_to_html(comment)} 
    153153            </fieldset> 
    154154          </div> 
    155155 
  • templates/report.rss

     
    2828              <title>#$row.id: $cell.value</title> 
    2929            </py:when> 
    3030            <py:when test="col == 'description'"> 
    31               <description>unicode($cell.parsed)</description> 
     31              <description>${unicode(wiki_to_html($cell.value, absurls=True))}</description> 
    3232            </py:when> 
    3333          </py:choose> 
    3434        </py:with> 
  • templates/browser.html

     
    7878                                 in trac.versioncontrol.web_ui.util.get_changes --> 
    7979                    <td class="change"> 
    8080                      <span class="author">$change.author:</span> 
    81                       <span class="change">$change.message</span> 
     81                      <span class="change">${wiki_to_oneliner(change.message)}</span> 
    8282                    </td> 
    8383                  </tr> 
    8484                </py:with> 
     
    9595            </th> 
    9696          </tr> 
    9797          <tr py:if="file"> 
    98             <td class="message">$file.message</td> 
     98            <td class="message">${wiki_to_html(file.message)}</td> 
    9999          </tr> 
    100100          <tr py:if="props"> 
    101101            <td colspan="2"> 
  • templates/macros.html

     
    2222  -      'selector'  is a boolean variable 
    2323  -      'name       is the name of the option 
    2424  -      'text'      is the displayed text, defaults to 'name' 
    25   -      'id'        optional id for the checkbox, if different from 'name'  
     25  -      'id'        optional id for the checkbox, if different from 'name' 
    2626  --> 
    2727  <py:def function="checkbox(selector, name, text=None, id=None)"> 
    2828    <py:with vars="id = id or name"> 
     
    4343  <py:def function="radiobuttons(selector, name, buttons)"> 
    4444    <label py:for="button in buttons" 
    4545           py:with="value = button[0]; text = button[1] or button[0]; default = button[3]"> 
    46       <input type="radio" id="$value" name="$name" value="$value"  
     46      <input type="radio" id="$value" name="$name" value="$value" 
    4747        checked="${selector == value or (default and selector not in values) and 'checked' or None}" /> 
    4848      $text 
    4949    </label> 
     
    5757  - 
    5858  -      We take care to not insert any extra space. 
    5959  --> 
    60    
    61   <py:def function="plural(cnt,noun,keepzero=False)"><py:if  
     60 
     61  <py:def function="plural(cnt,noun,keepzero=False)"><py:if 
    6262      test="cnt != 0 or keepzero" 
    6363      >${cnt == 1 and ('1 '+noun) or '%d %ss' % (cnt, noun)}</py:if></py:def> 
    6464 
     
    6969  <py:def function="sizeinfo(size)"><span title="$size bytes">${ 
    7070      pretty_size(size) 
    7171  }</span></py:def> 
    72      
     72 
    7373  <!--!  Display how many time elapsed since the given date. 
    7474  - 
    7575  -      Typically used in sentences like "changed ${dateinfo(date)} ago" 
     
    7979  <py:def function="dateinfo(date)"><span title="${format_datetime(date)}">${ 
    8080      pretty_timedelta(date) 
    8181  }</span></py:def> 
    82      
     82 
    8383  <!--!  Display a sequence of path components. 
    8484  - 
    8585  -      Each component is a link to the corresponding location in the browser. 
     
    8787  <py:def function="browser_path_links(path_links)"> 
    8888    <py:for each="idx, part in enumerate(path_links)"> 
    8989      <py:with vars="first = idx == 0; last = idx == len(path_links) - 1"> 
    90         <a class="${first and 'first' or None}"  
     90        <a class="${first and 'first' or None}" 
    9191          title="${first and 'Go to root directory' or 'View ' + part.name}" 
    9292          href="$part.href">$part.name</a> 
    9393        <py:if test="not last"><span class="sep">/</span></py:if> 
     
    105105  --> 
    106106  <py:def function="changeset_navigation(change, others=[])"> 
    107107    <li class="first" py:choose=""> 
    108       <py:when test="chrome.links.prev">  
     108      <py:when test="chrome.links.prev"> 
    109109        &larr; <a class="prev" py:attrs="chrome.links.prev[0]">Previous $change</a> 
    110110      </py:when> 
    111111      <py:otherwise> 
     
    115115    <li py:for="label, url in others"><a href="$url">$label</a></li> 
    116116    <li class="last" py:choose=""> 
    117117      <py:when test="chrome.links.next"> 
    118         <a class="next" py:attrs="chrome.links.next[0]">Next $change</a> &rarr;  
     118        <a class="next" py:attrs="chrome.links.next[0]">Next $change</a> &rarr; 
    119119      </py:when> 
    120120      <py:otherwise> 
    121121        <span class="missing">Next $change &rarr;</span> 
     
    167167          Try <a href="$preview.raw_href">downloading</a> the file instead. 
    168168        </py:when> 
    169169        <py:when test="not preview.rendered"> 
    170           <strong>HTML preview not available</strong>.  
     170          <strong>HTML preview not available</strong>. 
    171171          To view, <a href="$preview.raw_href">download</a> the file. 
    172172        </py:when> 
    173173      </py:choose> 
     
    182182  --> 
    183183  <py:def function="list_of_attachments(attachments, attach_href, compact=False)"> 
    184184    <py:def function="show_one_attachment(attachment)"> 
    185       <a href="$attachment.href" title="View attachment">$attachment.filename</a> 
    186         (${sizeinfo(attachment.size)}) - added by <em>$attachment.author</em>  
    187         ${dateinfo(attachment.date)} ago. 
     185      <a href="${attachment.href(req)}" title="View attachment">$attachment.filename</a> 
     186        (${sizeinfo(attachment.size)}) - added by <em>$attachment.author</em> 
     187        ${dateinfo(attachment.time)} ago. 
    188188    </py:def> 
    189189    <py:choose test=""> 
    190190      <py:when test="compact and attachments"> 
     
    192192        <ul> 
    193193          <li py:for="attachment in attachments"> 
    194194            ${show_one_attachment(attachment)} 
    195             <q py:if="compact and attachment.description">$attachment.description</q> 
     195            <q py:if="compact and attachment.description">${wiki_to_oneliner(attachment.description)}</q> 
    196196          </li> 
    197197        </ul> 
    198198      </py:when> 
     
    202202          <dl py:if="attachments" class="attachments"> 
    203203            <py:for each="attachment in attachments"> 
    204204              <dt>${show_one_attachment(attachment)}</dt> 
    205               <dd py:if="attachment.description">$attachment.description</dd> 
     205              <dd py:if="attachment.description">${wiki_to_oneliner(attachment.description)}</dd> 
    206206            </py:for> 
    207207          </dl> 
    208208          <form py:if="attach_href" method="get" action="$attach_href"> 
  • templates/wiki_history.html

     
    4747              </td> 
    4848              <td class="date">${format_datetime(item.date)}</td> 
    4949              <td class="author" title="IP-Address: $item.ipnr">$item.author</td> 
    50               <td class="comment">$item.comment</td> 
     50              <td class="comment">${wiki_to_oneliner(item.comment, shorten=True)}</td> 
    5151            </tr> 
    5252          </tbody> 
    5353        </table> 
  • templates/milestone_view.html

     
    8787        </fieldset> 
    8888      </form> 
    8989 
    90       <div class="description">${milestone.description}</div> 
     90      <div class="description">${wiki_to_html(milestone.description)}</div> 
    9191 
    9292      <div py:if="perm.has_permission('MILESTONE_MODIFY') or perm.has_permission('MILESTONE_DELETE')" class="buttons"> 
    9393        <form py:if="perm.has_permission('MILESTONE_MODIFY')" method="get" action=""> 
  • templates/ticket_new.html

     
    88 <head> 
    99  <title>New Ticket</title> 
    1010  <script type="text/javascript"> 
    11    addEvent(window, 'load', function() { document.getElementById('summary').focus()});  
     11   addEvent(window, 'load', function() { document.getElementById('summary').focus()}); 
    1212  </script> 
    1313 </head> 
    1414 
     
    3434    <div class="field"> 
    3535     <label for="description">Full description (you may use <a tabindex="42" 
    3636            href="${href.wiki('WikiFormatting')}">WikiFormatting</a> here):</label><br /> 
    37      <textarea id="description" name="description" class="wikitext" rows="10" 
    38                cols="78">${ticket.description}</textarea> 
    39      <fieldset py:if="preview" id="preview"> 
     37     <textarea id="description" name="description" class="wikitext" rows="10" cols="78"> 
     38${ticket.description}</textarea> 
     39     <fieldset py:if="ticket.description" id="preview"> 
    4040      <legend>Description Preview</legend> 
    41       ${preview} 
     41      ${wiki_to_html(ticket.description)} 
    4242     </fieldset> 
    4343    </div> 
    4444 
     
    8585 
    8686    </fieldset> 
    8787 
    88      
     88 
    8989    <p py:if="can_attach"> 
    9090     <label> 
    9191      <input type="checkbox" name="attachment" checked="${attachment or None}" /> 
     
    9999    </div> 
    100100 
    101101   </form> 
    102     
     102 
    103103   <script type="text/javascript" src="${chrome.htdocs_location}js/wikitoolbar.js"></script> 
    104104 
    105105   <div id="help"> 
  • templates/revisionlog.html

     
    116116                  </td> 
    117117                  <td class="date">$change.date</td> 
    118118                  <td class="author">$change.author</td> 
    119                   <td class="summary">${not verbose and change.message or ''}</td> 
     119                  <td class="summary">${not verbose and wiki_to_oneliner(change.message, shorten=True) or ''}</td> 
    120120                </tr> 
    121121 
    122122                <tr py:if="verbose"> 
    123                   <td class="summary" colspan="7">$change.message</td> 
     123                  <td class="summary" colspan="7">${wiki_to_html(change.message)}</td> 
    124124                </tr> 
    125125              </py:with> 
    126126            </py:for> 
  • templates/revisionlog.rss

     
    1616    <item py:for="item in items" py:with="change = changes[item.rev]"> 
    1717      <author py:if="change.author">$change.author</author> 
    1818      <pubDate>${format_datetime(change.date_seconds)}</pubDate> <!--! FIXME: use 'change.date' later on --> 
    19       <title>Revision $item.rev: $change.shortlog</title> 
     19      <title>Revision $item.rev: ${u' '.join(change.shortlog.striptags().splitlines())})</title> 
    2020      <link>${abs_href.changeset(rev, path)}</link> 
    2121      <guid isPermaLink="false">${abs_href.changeset(item.rev, item.path)}</guid> 
    22       <description>$change.message</description> 
     22      <description>${unicode(wiki_to_html(change.message, absurls=True))}</description> 
    2323      <category>Log</category> 
    2424    </item> 
    2525 
  • templates/report_view.html

     
    55    <span py:if="numrows and report.id != -1" class="numrows">($numrows matches)</span> 
    66  </h1> 
    77 
    8   <div py:if="report.description" id="description">$report.description</div> 
     8  <div py:if="report.description" id="description">${wiki_to_html(report.description)}</div> 
    99 
    1010  <div py:if="report.id != -1 and (report.can.create or report.can.modify or report.can.delete)" class="buttons"> 
    1111    <form py:if="report.can.modify" action="" method="get"> 
     
    108108 
    109109                    <py:when test="col == 'description'"> 
    110110                      <py:def function="cellclass"></py:def> 
    111                       <py:def function="content">$cell.parsed</py:def> 
     111                      <py:def function="content">${wiki_to_html(cell.value)}</py:def> 
    112112                    </py:when> 
    113113 
    114114                    <py:otherwise> 
  • templates/timeline.html

     
    3636        <h2>$day:</h2> 
    3737        <dl> 
    3838          <py:for each="event in events"> 
    39             <dt class="${event.kind}"><a href="${event.href}"> 
    40               <span class="time">${event.time}</span> ${event.title} 
    41             </a></dt> 
    42             <dd class="${event.kind}">${event.message}</dd> 
     39            <dt class="${event.kind}"> 
     40              <a href="${event.href}"><span class="time">${event.time}</span> ${event.title}</a> 
     41            </dt> 
     42            <dd class="${event.kind}" py:with="shorten = event.shorten_message is None and True or event.shorten_message"> 
     43              ${wiki_to_oneliner(event.message, shorten)} 
     44            </dd> 
    4345          </py:for> 
    4446        </dl> 
    4547      </py:for> 
  • templates/wiki_edit.html

     
    3333          <table id="info" summary="Revision info"> 
    3434            <tbody> 
    3535              <tr><th scope="col">Preview of future version ${page.version+1} (modified by $author)</th></tr> 
    36               <tr><td class="message">$comment_html</td></tr> 
     36              <tr><td class="message">${wiki_to_html(comment)}</td></tr> 
    3737            </tbody> 
    3838          </table> 
    3939          <fieldset id="preview"> 
    4040            <legend>Preview (<a href="#edit">skip</a>)</legend> 
    41             <div class="wikipage">$page_html</div> 
     41            <div class="wikipage">${wiki_to_html(page.text)}</div> 
    4242          </fieldset> 
    4343        </py:when> 
    4444        <py:when test="'collision'"> 
     
    6363            </select> 
    6464          </div> 
    6565          <p><textarea id="text" class="wikitext" name="text" cols="80" rows="$edit_rows"> 
    66 $page.text 
    67             </textarea> 
     66$page.text</textarea> 
    6867          </p> 
    6968          <script type="text/javascript"> 
    7069            var scrollBarPos = document.getElementById("scroll_bar_pos"); 
  • templates/timeline.rss

     
    1717   <title>${event.title}</title> 
    1818   <author py:if="event.author">${event.author}</author> 
    1919   <pubDate>${event.date}</pubDate> 
    20    <link>${event.href}</link> 
    21    <guid isPermaLink="false">${event.href}/${event.dateuid}</guid> 
    22    <description>${event.message}</description> 
     20   <link>${abs_href()}/${event.href}</link> 
     21   <guid isPermaLink="false">${abs_href()}/${event.href}/${event.dateuid}</guid> 
     22   <description>${unicode(wiki_to_html(event.message, absurls=True))}</description> 
    2323  </item> 
    2424 
    2525 </channel> 
  • templates/about.html

     
    6969              </tr> 
    7070              <tr py:if="plugin.description"> 
    7171                <th class="description" scope="row">Description</th> 
    72                 <td class="description">${plugin.description}</td> 
     72                <td class="description">${wiki_to_html(plugin.description)}</td> 
    7373              </tr> 
    7474              <tr py:for="idx,extension_point in enumerate(plugin.extension_points)"> 
    7575                <th py:if="idx == 0" class="xtnpts" 
    7676                  rowspan="${len(plugin.extension_points)}"> 
    7777                  Extension points: 
    7878                </th> 
    79                 <td class="xtnpts">         
     79                <td class="xtnpts"> 
    8080                  <code>${extension_point.module}.${extension_point.interface}</code> 
    8181                  <div py:if="extension_point.extensions" py:strip=""> 
    8282                    (${len(extension_point.extensions)} extensions) 
     
    8686                      </li> 
    8787                    </ul> 
    8888                  </div> 
    89                   <div class="description">${extension_point.description}</div> 
     89                  <div class="description">${wiki_to_html(extension_point.description)}</div> 
    9090                </td> 
    9191              </tr> 
    9292            </table> 
     
    102102        </a> 
    103103        <h1>About Trac ${trac.version}</h1> 
    104104        <p>Trac is a web-based software project management and bug/issue 
    105           tracking system emphasizing ease of use and low ceremony.  
    106           It provides an integrated Wiki, an interface to version control  
     105          tracking system emphasizing ease of use and low ceremony. 
     106          It provides an integrated Wiki, an interface to version control 
    107107          systems, and a number convenient ways to stay on top of events 
    108108          and changes within a project. 
    109109        </p> 
    110110        <p>Trac is distributed under the modified BSD License.<br /> 
    111           The complete text of the license can be found  
     111          The complete text of the license can be found 
    112112          <a href="http://trac.edgewall.org/wiki/TracLicense">online</a> 
    113113          as well as in the <tt>COPYING</tt> file included in the distribution.</p> 
    114114        <a href="http://www.python.org/" style="border: none; float: right"> 
    115115          <img style="display: block" src="${chrome.htdocs_location}python.png" 
    116116            alt="python powered" width="140" height="56" /> 
    117117        </a> 
    118         <p>Please visit the Trac open source project:  
     118        <p>Please visit the Trac open source project: 
    119119          <a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a></p> 
    120120        <p>Copyright &copy; 2003-2006 
    121121          <a href="http://www.edgewall.org/">Edgewall Software</a></p> 
  • templates/roadmap.html

     
    1616 
    1717    <div id="content" class="roadmap"> 
    1818      <h1>Roadmap</h1> 
    19        
     19 
    2020      <form id="prefs" method="get" action=""> 
    2121        <div> 
    2222          <input type="checkbox" id="showall" name="show" value="all" 
     
    6262            </py:if> 
    6363          </div> 
    6464 
    65           <div class="description">${milestone.description}</div> 
     65          <div class="description">${wiki_to_html(milestone.description)}</div> 
    6666 
    6767        </li> 
    6868      </ul> 
  • templates/ticket.rss

     
    44 
    55    <title>${project.name}: Ticket $title</title> 
    66    <link>${abs_href.ticket(id)}</link> 
    7     <description>${unicode(description)}</description> 
     7    <description>${unicode(wiki_to_html(ticket.description, absurls=True))}</description> 
    88    <language>en-us</language> 
    99    <image py:if="chrome.logo.src"> 
    1010      <title>$project.name</title> 
     
    1818      <pubDate>${http_date(change.date)}</pubDate> 
    1919      <title>$change.title</title> 
    2020      <link>${abs_href.ticket(id)}<py:if test="change.cnum">#comment:$change.cnum</py:if></link> 
    21       <guid isPermaLink="false">${abs_href.ticket(id)}<py:if test="change.cnum">#comment:$change.cnum</py:if></guid> 
     21      <guid isPermaLink="false">${abs_href.ticket(id)}<py:if test="change.cnum">#comment:$change.cnum</py:if></guid     > 
    2222      <description> 
    2323        <py:if test="change.fields"> 
    2424          &lt;ul&gt; 
    2525          <py:for each="field, value in change.fields.iteritems()"> 
    26             &lt;li&gt;&lt;strong&gt;$field&lt;/strong&gt;  
     26            &lt;li&gt;&lt;strong&gt;$field&lt;/strong&gt; 
    2727            <py:choose> 
    2828              <py:when test="not value.old"> 
    2929                set to &lt;em&gt;$value.new&lt;/em&gt; 
     
    3939          </py:for> 
    4040          &lt;/ul&gt; 
    4141        </py:if> 
    42         $change.comment 
     42        ${unicode(wiki_to_html(change.comment, absurls=True))} 
    4343      </description> 
    4444      <category>Ticket</category> 
    4545    </item> 
  • templates/attachment.html

     
    7777          <tbody> 
    7878            <tr> 
    7979              <th scope="col"> 
    80                 File $attachment.filename, ${sizeinfo(attachment.size)}  
    81                 (added by $attachment.author,  ${dateinfo(attachment.date)} ago) 
     80                File $attachment.filename, ${sizeinfo(attachment.size)} 
     81                (added by $attachment.author,  ${dateinfo(attachment.time)} ago) 
    8282              </th> 
    8383            </tr> 
    8484            <tr> 
    85               <td class="message">$attachment.description</td> 
     85              <td class="message">${wiki_to_html(attachment.description)}</td> 
    8686            </tr> 
    8787          </tbody> 
    8888        </table> 
  • templates/wiki_diff.html

     
    5252        <dt class="property message">Comment:</dt> 
    5353        <dd class="message" py:choose=""> 
    5454          <em py:when="multi" class="multi">(multiple changes)</em> 
    55           <py:otherwise>$comment</py:otherwise> 
     55          <py:otherwise>${wiki_to_html(comment)}</py:otherwise> 
    5656        </dd> 
    5757      </dl> 
    5858      <div class="diff"> 
  • templates/wiki_view.html

     
    2020        <li><a href="${href.wiki('RecentChanges')}">Index by Date</a></li> 
    2121        <li class="last"> 
    2222          <a href="${req.href.wiki(page.name, action='diff', version=page.version)}">Last Change</a> 
    23         </li>  
     23        </li> 
    2424      </ul> 
    2525      <hr /> 
    2626    </div> 
    2727 
    2828    <div id="content" class="wiki"> 
    29        
    30       <py:if test="comment_html"> 
     29 
     30      <py:if test="version"> 
    3131        <table id="info" summary="Revision info"> 
    3232          <tbody> 
    3333            <tr><th scope="col">Version $page.version (modified by $page.author, ${dateinfo(page.time)} ago)</th></tr> 
    34             <tr><td class="message">$comment_html</td></tr> 
     34            <tr><td class="message">${wiki_to_html(comment or '--')}</td></tr> 
    3535          </tbody> 
    3636        </table> 
    3737      </py:if> 
    3838 
    3939      <div class="wikipage"> 
    40         <div id="searchable">$page_html</div> 
     40        <div id="searchable">${wiki_to_html(page.text)}</div> 
    4141      </div> 
    4242 
    4343      ${list_of_attachments(attachments, attach_href, compact=True)} 
  • templates/changeset.html

     
    105105          <dd class="$prop.htmlclass">$prop.value</dd> 
    106106          </span> 
    107107          <dt class="property message">Message:</dt> 
    108           <dd class="message" id="searchable">${changeset.message or '&nbsp;'}</dd> 
     108          <dd class="message" id="searchable">${wiki_to_html(changeset.message)}</dd> 
    109109        </py:if> 
    110110        <dt class="property files">${filter(None, changes) and 'Files:' or '(No files)'}</dt> 
    111111        <dd class="files"> 
  • templates/milestone_edit.html

     
    1313    <link rel="stylesheet" type="text/css" 
    1414          href="${chrome.htdocs_location}css/roadmap.css" /> 
    1515    <script type="text/javascript"> 
    16       addEvent(window, 'load', function() { document.getElementById('name').focus()});  
     16      addEvent(window, 'load', function() { document.getElementById('name').focus()}); 
    1717    </script> 
    1818  </head> 
    1919 
     
    8282            <label for="description">Description (you may use <a tabindex="42" 
    8383                   href="${href.wiki('WikiFormatting')}">WikiFormatting</a> here):</label> 
    8484            <p><textarea id="description" name="description" class="wikitext" rows="10" cols="78"> 
    85 ${milestone.description_source}</textarea></p> 
     85${milestone.description}</textarea></p> 
    8686          </fieldset> 
    8787        </div> 
    8888        <div class="buttons" py:choose="milestone.exists"> 
  • templates/query_div.html

     
    5656            <td colspan="${len(headers)}"> 
    5757              <p class="meta">Reported by <strong>$result.reporter</strong>, 
    5858                ${dateinfo(result.time)} ago${result.description and ':' or ''}</p> 
    59               <p py:if="result.description">$result.description</p> 
     59              <py:if test="result.description">${wiki_to_html(result.description)}</py:if> 
    6060            </td> 
    6161          </tr> 
    6262 
  • templates/query.rss

     
    1717      <title>#$result.id: $result.summary</title> 
    1818      <pubDate py:if="result.time">${http_date(result.time)}</pubDate> 
    1919      <author py:if="result.reporter">$result.reporter</author> 
    20       <description>${unicode(result.description)}</description> 
     20      <description>${unicode(wiki_to_html(result.description, absurls=True))}</description> 
    2121      <category>Results</category> 
    2222      <comments>$href#changelog</comments> 
    2323    </item>