Markaby is nifty and all, but to my horror, just now I found out that it enforces the standards! That’s no way to live! A world of ideals and hopes and dreams. Okay so here is how to hack markaby to let you use an attribute that isn’t in the specs:

Markaby::XHTMLStrict.tagset[:option] << :"data-href"

And now you can use option(”blah”, :”data-href” => “nifty stuff!”) to transport nifty stuff to the funky cool javascripts in your page. Of course your page won’t validate anymore, but you’ll have a warm cuddly feeling because you are still using a standard, even if it’s a draft standard and not the one you specified with your doctype, and your app will work and have nice clean output! This hack would be especially useful for using Dojo with markaby. :)

  1. @auto_validation = false

    I had to do this to make some dojo crap. Yours does have the benefit of odd validation, but I always say, “no!!, don’t tell me what to do!”

    doki_pen May 30th, 2008 at 2:15 am
  2. I’m not using this for validation, I am using it to signal data to the scripts running on the webpages so useful behavior can be attached simply.

    Blueberry May 30th, 2008 at 8:14 am

You must be logged in to post a comment.