Modify

Opened 11 years ago

Closed 11 years ago

#134 closed defect (wontfix)

helloworld doesn't work as advertized with 0.93

Reported by: villaume Owned by: Alec Thomas
Priority: normal Component: TracHacks
Severity: normal Keywords: egg, helloworld, Markup
Cc: Trac Release:

Description

when I run the helloworld egg example with python 2.3 and trac 0.93. http://trac-hacks.org/wiki/EggCookingTutorial/BasicEggCooking

Instead of a button in the nav bar, I get this, verbatim:

<a href="/trac/helloworld">Hello</a> 

-- no borders and it's clearly not a link. So it's doing the string substitution, but not making a button.

Attachments (0)

Change History (4)

comment:1 Changed 11 years ago by villaume

The fix, as suggested by Brad Anderson <brad@dsource.org> and Jani Tiainen <redetin@…>, involves the Markup class.

Two lines need to be changed (I'd submit a patch, but I don't know how to do this on W2K): Instead of

from trac.util import escape 

add Markup, like this:

from trac.util import escape, Markup

Then, instead of

   def get_navigation_items(self, req):
        yield 'mainnav', 'helloworld', '<a href="%s">Hello</a>' \
                                  % escape(self.env.href.helloworld())

use the Markup class like this:

   def get_navigation_items(self, req):
        yield 'mainnav', 'helloworld', Markup('<a href="%s">Hello</a>' 
                                  % escape(self.env.href.helloworld()))

This installs and runs fine for me.

comment:2 Changed 11 years ago by villaume

my bad, those changes are in the helloworld.py file.

comment:3 Changed 11 years ago by Alec Thomas

This is a collaborative Wiki, you can make these changes yourself. Just edit the page to update the browsable version, and upload a new ZIP file with an appropriate comment about 0.9.3 compatibility.

comment:4 Changed 11 years ago by Alec Thomas

Resolution: wontfix
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.