haml1k converts static haml markup into html.(markup in the left textarea , result in the right one after a click on the button(tab , space is a shortcut)
V="value";E="createElement";F="appendChild";G="slice";Y="replace";H="match";L="length";X="textarea";I=document;Q='style';K=I[E](X);N=I[E](X);D=I[E]("button");b[F](K);b[F](D);b[F](N);N[Q].height=K[Q].height='400px';D.onclick=function(){try{g()}catch(e){N[V]='bad haml'}};M=function(){B=dT[L]-X;for(m=0;m<B;m++)s+="</"+dT.pop()+">\n"};g=function(){var c=K[V];t=c[H](/[^\r\n]+/g);var a;cT="b";dT=[];cK=R=0;q='"';s="";for(c=0;c<t[L];c++)if(a=t[c],A=0,X=((" "+a)[H](/^\ +/)[0][L]-1)/2,""!==a&&"\n"){S=cK-X;if(-1>S)return;0<=S&&M();cK=X;R=1;a=a[G](X+X);W=a[G](1)[H](/\w+([a-zA-Z]*)/)[0];if("%"==a[0])cT=W,s+="<"+W;else if("."==a[0]||"#"==a[0])cT="div",s+="<div "+("#"==a[0]?"id":"class")+"="+q+W+q;else{s+=a+"\n";R=0;continue}A=1+W[L];f=a[G](A)[Y](/^\s+|\s+$/g,"");if(x=f[H](/\{.+\}/)){A=x[0][L];v=eval("Object("+x[0][Y](/:([a-zA-Z]*)/g,function(a){return q+a[G](1)+q})[Y](/\=\>/g,":")+")");for(p in v)s+=" "+p+"="+q+v[p]+q;f=f[G](A)[Y](/^\s+|\s+$/g,"")}s+=">\n";""!==f?(s+=" "+f+" \n</"+cT+">\n",R=0):dT.push(cT)}X=0;M();N[V]=s};
Vj0idmFsdWUiO0U9ImNyZWF0ZUVsZW1lbnQiO0Y9ImFwcGVuZENoaWxkIjtHPSJzbGljZSI7WT0icmVwbGFjZSI7SD0ibWF0Y2giO0w9Imxlbmd0aCI7WD0idGV4dGFyZWEiO0k9ZG9jdW1lbnQ7UT0nc3R5bGUnO0s9SVtFXShYKTtOPUlbRV0oWCk7RD1JW0VdKCJidXR0b24iKTtiW0ZdKEspO2JbRl0oRCk7YltGXShOKTtOW1FdLmhlaWdodD1L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