Álvaro J. Iradier wrote:
> After some digging...
> later in convert_content, I call 'trac.wiki.formatter.wiki_to_html':
>
> ----------
> page = trac_wiki_to_html(text, env, req, absurls=True)
> ----------
>
> which is:
>
> ----------
> def wiki_to_html(wikitext, env, req, db=None,
>                  absurls=False, escape_newlines=False):
>     if not wikitext:
>         return Markup()
>     abs_ref, href = (req or env).abs_href, (req or env).href
>     context = Context.from_request(req, absurls=absurls)
> ----------
>
> and Context.from_request:
>
> -----------
>     def from_request(cls, req, resource=None, id=False, version=False,
>                      absurls=False):
>
>         #....
>
>         self = cls(Resource(resource, id=id, version=version), href=href,
>                    perm=perm)
> -----------
>
> So resource will always be None in the used context...
>
> is there a suggested workaround?
> or should I write my own version of wiki_to_html function and create a
> Context object using the constructor instead of Content.from_request?
>   

The wiki_to... are the "legacy" 0.10 functions which don't know about 
the Context.
Look for format_to... functions in the same file, this is what you 
should use.

-- Christian

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to