Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Markaby compat #55

Open
judofyr opened this Issue Jan 25, 2012 · 13 comments

Comments

Projects
None yet
4 participants
Owner

judofyr commented Jan 25, 2012

No description provided.

Owner

judofyr commented Jan 25, 2012

  • text "You & Me" is now escaped
  • There's no xhtml_strict
  • helpers is missing
Owner

judofyr commented Jan 25, 2012

input({name:1}, {value:2}) is not supported

Owner

DaveEveritt commented Jan 25, 2012

is xhtml_strict still necessary, now the standard is no longer being developed? HTML5 for me.

Owner

judofyr commented Jan 25, 2012

I think we'll do a:

def xhtml_strict(*a,&b)
  warn "xhtml_strict is no longer supported (or an active standard); using HTML5 instead"
  html(*a,&b)
end
Owner

DaveEveritt commented Jan 25, 2012

I think as brief as possible - "xhtml_strict is no longer a supported standard; using HTML5 instead". Worth bearing in mind that although "HTML 5 includes an XML serialization known as XHTML 5" XTML 5 will still have the IE mime-type issue, so I reckon it's safer to force HTML5 and wait to see if XHTML 5 gets taken up by developers.

@judofyr judofyr added a commit that referenced this issue Jan 25, 2012

@judofyr judofyr Better Markaby compat #55 c5482c7
Owner

judofyr commented Jan 25, 2012

Alright:

  • I haven't changed text; I think it's better to default to escaping
  • xhtml_strict and friends are now defined
  • input({name:1}, {value:2}) should now work in Mab-master
  • html will now also output a doctype.

BTW, should html in Mab default to outputting the doctype, or only Camping::Mab? /cc @Bluebie

Owner

Bluebie commented Jan 26, 2012

As far as I've been able to tell, xhtml 5 is only for compat with things like builder - letting you output xml-syntax and having browsers be okay with that. I haven't heard of it adding any extra functionality, and the whatwg were recommending in the standards that you use html syntax if you can, so I think supporting it would be a waste of time and a mistake if we have reliable html syntax output.

I agree about text being escaped so long as we add a warn to gem installation for the next version. Maybe a nice way to get around the escaping issue would be to provide an extra meaning for #html - if you call it with a string, it returns that string augmented with a little notice to Mab, asking it not to be escaped. Then you could do things like a(html("<b>bold link</b>"), :href => FancyController)

I feel like html should emit a doctype. I struggle to think of any situations where you wouldn't want a doctype, in camping or otherwise, so my feeling is that Mab aught to do that.

paulvt commented Jan 30, 2012

Well, I agree that there is almost no situation where you wouldn't want a doctype, it is still inconsitent for one method call to generate two elements in a sense. It is a surprise. Besides that, I have used other markup DSLs (HAML, etc.) and they all have a separate thing for doctypes (e.g. HAML).

Owner

Bluebie commented Jan 30, 2012

I like your thoughts on The Least Surprised. Still, it seems like it maybe a delightful surprise! Tradition seems like an uninteresting reason to do something.

paulvt commented Jan 30, 2012

Except that I am just porting Camping 2.0-code and now suddenly, unexpectedly have 2 doctypes. :)

Owner

judofyr commented Jan 30, 2012

I like your thoughts on The Least Surprised.

Don't we all?

Except that I am just porting Camping 2.0-code and now suddenly, unexpectedly have 2 doctypes. :)

This is only a bug on Mab-master + Camping-prerelase. Markaby didn't have a doctype method at all (I've never seen anyone use it at least), so I think automatic doctype is useful…

Owner

Bluebie commented Jan 30, 2012

Yup. On more complex websites (like mine!) a browser will see a page with no doctype as a 90's era page, and go in to compatibility mode, which will ruin all my CSS and Javascript! Two doctypes probably wouldn't break anything though! :)

Owner

DaveEveritt commented Jan 31, 2012

@judofyr LOL The Least Surprised...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment