capture ruby block in erb and slim templates, fixes #1582