The Pug Automatic

Comma concatenation for punctuation after link in Haml

Written November 5, 2007. Tagged Ruby, Ruby on Rails.

This post is just to suggest that in Haml (which I can't decide if I like or not), rather than something like

%p
You are logged in.
= succeed "?" do
= link_to("Log out", "#")

consider

%p
You are logged in.
= link_to("Log out", "#"), "?"

Using string concatenation to avoid the fugly succeed helper is fairly obvious, but I think that specifically using , has a nice flow to it in the common case of a link followed directly by punctuation.