Html5Properties with different HtmlParser

28 views
Skip to first unread message

mraccola

unread,
Jan 13, 2011, 10:49:14 AM1/13/11
to Lift
I want to produce Html5 output but I am not crazy about the way the
Lift Html parser handles my Lift templates. Would it be a bad idea to
use the Html5Properties object as the default but swap out the
HtmlParser like this:

LiftRules.htmlProperties.default.set((r: Req) =>new
Html5Properties(r.userAgent).setHtmlParser(PCDataXmlParser.apply _))

Also, I see the default for HtmlProperties is called
OldHtmlProperties...this seems to imply that the default
implementation is going to be phased out...or at the very least is a
2nd-best option. Is my assessment correct?

greekscala

unread,
Jan 13, 2011, 11:55:15 AM1/13/11
to Lift
Hello,

I am thinking about this too. I would like to have Html5 as output
and use the old template style in xhtml. I do not like the new style.
It seems to be inconsistent in my eyes.

When I have a <span class="lift:Msg?id=text"></span> then I expect
if I do not set an error, that this element is stripped. No
I get a <span id="text"></span> and this id collides with the element
ones the error was for. With <lift:Msg> tags this tags are then
stripped
and everything is fine!

best regards

David Pollak

unread,
Jan 13, 2011, 12:08:27 PM1/13/11
to lif...@googlegroups.com
On Thu, Jan 13, 2011 at 7:49 AM, mraccola <mrac...@yahoo.com> wrote:
I want to produce Html5 output but I am not crazy about the way the
Lift Html parser handles my Lift templates.  Would it be a bad idea to
use the Html5Properties object as the default but swap out the
HtmlParser like this:

LiftRules.htmlProperties.default.set((r: Req) =>new
Html5Properties(r.userAgent).setHtmlParser(PCDataXmlParser.apply _))

This is fine.  But you'll have some deltas for your designers (e.g. <div class="foo&amp;bar">)
 

Also, I see the default for HtmlProperties is called
OldHtmlProperties...this seems to imply that the default
implementation is going to be phased out...or at the very least is a
2nd-best option.  Is my assessment correct?

This uses the smattering of LiftRules to define behavior rather than having the behavior on the HtmlProperties instance itself.  That's why it's Old/legacy.

I'm happy to add a cross-section of different HtmlProperties that are pre-defined (e.g., XHTML in/Html5 out, etc.)

Let's make a list of what people want and open a ticket at http://ticket.liftweb.net referencing this thread.
 

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

mraccola

unread,
Jan 14, 2011, 10:49:51 AM1/14/11
to Lift
Reply all
Reply to author
Forward
0 new messages