Interesting, thank you, I'll try this on Monday... On Feb 5, 3:11 am, Simon Cross <[email protected]> wrote: > On Sat, Feb 5, 2011 at 10:57 AM, jerry <[email protected]> wrote: > > I don't think this will work, because format_to_html seems to return > > genshi.core.Markup object, and I don't know how to get the string out > > of that. > > genshi.core.Markup is just a subclass of Python's unicode class. The > most straight forward way to do what you want is something like: > > u = unicode(markup_instance) > ... work on ordinary string ... > markup_instance = Markup(u) > > Another option is just to perform all your string manipulation on the > Markup instance directly. Markup instances escape strings they are > added to and arguments passed to % formatting (unless these are also > Markup instances). You can read all the details > athttp://genshi.edgewall.org/wiki/ApiDocs/genshi.core#genshi.core:Markup. > > Schiavo > Simon
-- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
