Golf: Dehamlizing


#1

Challange 5035e5b3838d9e000200006d - convert haml to erb

Input

%tr
  %td= raw("<%= line1_hello %>")
  %td= raw("<%= line2(world) %>")
  %td= raw("<%= line3_hello %>")
  %td= raw("<%= line4 %>")
  %td= raw("<%= line5_(world) %>")

Output

<tr>
  <td><%= line1_hello %></td>
  <td><%= line2(world) %></td>
  <td><%= line3_hello %></td>
  <td><%= line4 %></td>
  <td><%= line5_(world) %></td>
</tr>

Vim best: 32

My best so far: 37 with %s><ret>mdlp<a-f>=dmmQZbi<backspace><lt><esc>a<gt><esc>yza<lt>/<esc>pQ<a-i>i<a-;>q,q


#2

I’m at 35: r<lt>A<gt><esc>%s"<ret>c<lt>td<gt><esc><a-i>by<a-x>_Rbi/<esc><space>o<lt>/tr<gt><esc>,q

That was pretty hard!


#3

Ooooh clever! Good job :+1: