Opened 9 years ago

Closed 5 years ago

rendering of included html does not work

Reported by: Owned by: martin.jung@… Noah Kantrowitz normal IncludeMacro normal 0.10

As described in #1454 the rendering of included html does not work but the html source is displayed instead.

Maybe I am missing something, but I tried quite a few combinations of html input and Include syntax, e.g. [[Include(source:/trunk/test.html, text/html)]] or [[Include(source:/trunk/test.html)]]. The workaround [[Include(http://trac-server/browser/trunk/test.html?format=raw)]] also shows the html source only.

However, if whole other wiki pages are included, they are rendered correctly...

Thanks for cleaning up misunderstandings or fixing the issues.

And of course, thanks for the handy plugin :)

comment:1 Changed 9 years ago by Eli Heady

I'm experiencing the same issue (trac 0.11 and 0.11.2, IncludeMacro 2.1).

I've tried the following

[[Include(http://url,text/html)]]
and
[[Include(http://url,None)]]


html is converted (< becomes &lt, etc). Also, the included html is wrapped in <pre></pre>

btw, in trac.ini:

[wiki]
render_unsafe_content = true


Martin: have you tried altering render_unsafe_content in trac.ini?

comment:3 Changed 9 years ago by anonymous

To add some environment data: I am using Trac 0.11.1 and IncludeMacro 2.1

I have tried the following combinations

[[Include(source:trunk/test.html, text/html)]]
[[Include(source:trunk/test.html, None)]]
[[Include(http://server/project/browser/trunk/test.html, None)]]
[[Include(http://server/project/browser/trunk/test.html, text/html)]]


And yes, I should have stated that before: all the render_unsafe_content are set to true (wiki, browser, attachment).

Still, all html code is escaped and enclosed in div and pre as described by eli.

comment:4 Changed 9 years ago by anonymous

Here's a not ideal workaround.

Set the mimetype of the included page to text/x-trac-wiki, and edit the included page to utilize the #!html wikiprocessor.

Example in a trac wiki page (where the included html should appear:

[[Include(http://someurl.html, text/x-trac-wiki)]]


someurl.html contents:

{{{
#!html
<h1>My html to include</h1>
}}}


This only works, of course, if you can alter the html to be included, and it make your souce html somewhat unsuitable for other purposes (ie, rendering directly in a browser)

--eli

comment:5 Changed 5 years ago by Ryan J Ollos

Description: modified (diff) → duplicate new → closed

I haven't found a solution yet, but closing this since it's a duplicate of #1454.

Modify Ticket

Change Properties