#9292 closed defect (worksforme)
mimeview api format_to_html strips image url
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.12dev |
Severity: | normal | Keywords: | |
Cc: | nzoltan@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The format_to_html in mimeview api strips img urls, when images attached and embedded with Image macro. URLs fine, when embedded image url are outside links.
Here is a simple Wiki page:
= test page = This is an image: [[Image(whatever.png)]]
Then the result of format_to_html is:
<h1 id="testpage">test page</h1> <p> This is an image: <a style="padding:0; border:none"><img /></a> </p>
Attachments (0)
Change History (5)
comment:1 by , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
comment:3 by , 14 years ago
Thank you very much! On the basis of this pointer I solved this problem with success. :)
- context = Context.from_request(req, absurls=False) + resource = Resource('wiki', pagename) + context = Context.from_request(req, resource, absurls=False)
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 by , 14 years ago
Resolution: | fixed → worksforme |
---|
Perfect! I know it's not always easy to know if you've hit a bug or you're simply not using the API correctly (especially when there's no API doc, as for this one, my bad), but in any case it's sometimes faster to ask on the Trac-dev MailingList.
As for this ticket, the resolution fixed is reserved to the case some actual changes needed to be made in the repository.
The context parameter to
format_to_html
needs to be properly set up, in particular it should specify the.resource
to which the wiki text you're formatting is belonging to.This is important so that relative links can be correctly expanded and, as in your example, that attachments can be found (
Image(whatever.png)
meanswhatever.png
is the name of a file attached to the current resource).