On Sun Jul 07 03:06:06 2013, CJM wrote:
Show quoted text> At first I was inclined to agree that this is a bug, but after
> starting to try to fix it, I think it should just be documented.
> The problem is that I was having difficulty pinning down exactly
> when the explicit <html> tag should be merged with the implicit
> one.
>
> In your example of '<html>...</html>', it seems obvious it should be
> merged, but what if you have something before the <html> tag?
>
> If you have '<!DOCTYPE html><html>...' it should probably still be
> merged.
>
> If you have '<!--hi--><html>' it should probably be merged, but then
> you can no longer tell the difference between that and '<html><!--
> hi-->'.
>
> I think it's simpler to just document that implicit_tags(0) always
> gives you an implicit <html> tag containing whatever explicit
> content you had (possibly starting with an explicit <html> tag).
I think a reasonable interpretation is that implicit_tags(0) would disable all implicit tags, and you wouldn't do any merging.
i.e. the bug is that when you set implicit_tags(0) you still get implicit tags, and you should get none.
If you don't supply everything you need, then bad luck.
Documenting the limitation is of course also a reasonable option if that is more effort than it's worth :)
It may be useful in the long run since I think one of the bad things about the current as_HTML is that it doesn't allow you to generate HTML fragments and there are lots of use cases where that would be a cool feature. It would also be super awesome if you could just turn off the implicit html and body tags, but pop in all those implicit tags lower down that make your HTML sane.
Ponies ;)
Cheers, Jeff.