Opened 13 years ago
Last modified 13 years ago
#8466 closed defect
wiki.getPageHTML on page with image returns empty image — at Version 3
Reported by: | Owned by: | osimons | |
---|---|---|---|
Priority: | high | Component: | XmlRpcPlugin |
Severity: | major | Keywords: | image url wiki_to_html |
Cc: | Trac Release: | 0.12 |
Description (last modified by )
Image attached to page as [[Image(tab1.JPG)]]
is fine in wiki, but calling getPageHTML
returns empty tag: <img />
Trac v0.12.1 TracXMLRPC v1.1.0
Change History (3)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Keywords: | url wiki_to_html added |
---|
The following patch fixes it for me (thx to comment from t:#9292).
NB: that according to the trac source, wiki_to_html
has been deprecated and format_to_html
should be used instead.
-
wiki.py
a b 14 14 from trac.resource import Resource, ResourceNotFound 15 15 from trac.wiki.api import WikiSystem 16 16 from trac.wiki.model import WikiPage 17 from trac.wiki.formatter import wiki_to_html 17 from trac.wiki.formatter import wiki_to_html, format_to_html 18 from trac.mimeview import Context 18 19 19 20 from tracrpc.api import IXMLRPCHandler, expose_rpc, Binary 20 21 from tracrpc.util import StringIO, to_utimestamp, from_utimestamp … … 94 95 def getPageHTML(self, req, pagename, version=None): 95 96 """ Return page in rendered HTML, latest version. """ 96 97 text = self.getPage(req, pagename, version) 97 html = wiki_to_html(text, self.env, req, absurls=1) 98 #html = wiki_to_html(text, self.env, req, absurls=1) 99 resource = Resource('wiki', pagename) 100 context = Context.from_request(req, resource, absurls=1) 101 html = format_to_html(self.env, context, text) 98 102 return '<html><body>%s</body></html>' % html 99 103 100 104 def getAllPages(self, req):
comment:3 Changed 13 years ago by
Description: | modified (diff) |
---|
Note: See
TracTickets for help on using
tickets.
Forgot to mention,
getPage
returns[[Image(tab1.JPG)]]
correctly.