﻿id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
3979	can not include external html	jholg	coderanger	"Whilst logged in with INCLUDE_URL permission I am not able to include valid html.
I'm currently looking into adding intertrac capabilities to includemacro and started out with simply trying to include stuff from other trac projects via a fully qualified URL. However, these are always empty. 
By accident, I used NewsFlashMacro on one of these pages, and suddenly this page could be successfully included.

I found out that using NewsFlashMacro with the [[NewsFlashStart]] and [NewsFlashEnd]] directives subtly breaks invalid xhtml-1.0-strict (should add another bug report over there...):

Validation Output:  49 Errors

   1. Error Line 87, Column 22: document type does not allow element ""div"" here; missing one of ""object"", ""ins"", ""del"", ""map"", ""button"" start-tag.

      <div class=""newsflash"">

      ✉

      The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

      One possible cause for this message is that you have attempted to put a block-level element (such as ""<p>"" or ""<table>"") inside an inline element (such as ""<a>"", ""<span>"", or ""<font>"").
   2. Error Line 88, Column 3: end tag for ""div"" omitted, but OMITTAG NO was specified.

      </p>

      ✉

      You may have neglected to close an element, or perhaps you meant to ""self-close"" an element, that is, ending it with ""/>"" instead of "">"".
   3. Info Line 87, Column 0: start tag was here.

      <div class=""newsflash"">

   4. Error Line 90, Column 5: end tag for ""p"" omitted, but OMITTAG NO was specified.

      </div>

      ✉

      You may have neglected to close an element, or perhaps you meant to ""self-close"" an element, that is, ending it with ""/>"" instead of "">"".


However, as a side effect, this suddenly makes the included content (well, parts of it) visible in the including wiki page.

I ''think'' this is due to the genshi HTMLSanitizer running on the included page: If the included page is valid xhtml, then nothing will ever be included because the <html> tag is not an allowed tag in the HTMLSanitizer default configuration. Otherwise, by producing invalid xhtml, the genshi parser suddenly throws the parsed token in a different order. In effect, this produces START and END yields ''after'' </html> has been given to the sanitizer.

So I suspect using the HTMLSanitizer the way it is used here will always filter out the whole content of any xhtml-strict page.

???
Have to look into this further...
Any hints appreciated.

Holger

"	defect	closed	normal	IncludeMacro	normal	wontfix	xhtml, xhtml-strict		0.11
