implement simple html2json, use switch in LiveScript style