[ToscaWidgets] #40: Resouce injection always produces XHMTL (no HTML possible)

0 views
Skip to first unread message

Trac from toscawidgets.org

unread,
Mar 25, 2009, 2:14:23 PM3/25/09
to toscawidge...@groups.google.com
#40: Resouce injection always produces XHMTL (no HTML possible)
--------------------+-------------------------------------------------------
Reporter: chrisz | Owner: alberto
Type: defect | Status: new
Priority: major | Milestone:
Component: core | Version: 0.9
Keywords: |
--------------------+-------------------------------------------------------
The resource injection mechnanism of TW 0.9.5 uses the !ToscaWidgets
default engine plugin. With that engine you can't switch between HTML and
XHTML output - you always get what's in the template, and that's XHTML. If
you're using HTML for your pages, the ressouce injection makes them
invalid.

The actual problem here are the CSS links which are defined like this:
{{{
class CSSLink(Link,CSSMixin):
template = """<link rel="stylesheet" ... href="$link" />"""
}}}
So you always get the trailing slash, not matter whether you're using HTML
for your page or not. And I think there is no way to create markup that is
both valid HTML and XHTML in this case. Adding a closing {{{</link>}}} tag
is not valid HTML, unfortunately.

One solution (though a really ugly one) would be to use your own
HTMLCSSLink class with a modified template instead of CSSLink, but this
works only for your own widgets. You could also monkey-patch the CSSLink
class of !ToscaWidgets, but that is even uglier.

I think the proper solution would be to improve the !ToscaWidgets
ressource injector so that it 1) recognizes the type of the page from its
docstring and 2) injects the markup corresponding to that type.

--
Ticket URL: <http://toscawidgets.org/trac/tw/ticket/40>
ToscaWidgets </trac/tw>
ToscaWidgets - Web Widgets

Trac from toscawidgets.org

unread,
Jul 21, 2009, 5:35:38 AM7/21/09
to toscawidge...@groups.google.com
#40: Resouce injection always produces XHMTL (no HTML possible)
--------------------+-------------------------------------------------------
Reporter: chrisz | Owner: droggisch
Type: defect | Status: accepted
Priority: major | Milestone:
Component: core | Version: 0.9
Keywords: |
--------------------+-------------------------------------------------------
Changes (by droggisch):

* cc: droggisch (added)
* owner: alberto => droggisch
* status: new => accepted


Comment:

I'm working on a solution to this, remind me of that if I don't come back
to you with this.

--
Ticket URL: <http://toscawidgets.org/trac/tw/ticket/40#comment:1>

Reply all
Reply to author
Forward
0 new messages