Modify

Opened 6 years ago

Closed 2 years ago

#4114 closed defect (duplicate)

rendering of included html does not work

Reported by: martin.jung@… Owned by: coderanger
Priority: normal Component: IncludeMacro
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description (last modified by rjollos)

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 :)

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by eli

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:2 Changed 6 years ago by eli

  • Cc eli@… added

comment:3 Changed 6 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 6 years ago by anonymous

  • Cc eli@… removed

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 2 years ago by rjollos

  • Description modified (diff)
  • Resolution set to duplicate
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from coderanger. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.