Helpers (succeed, surround etc.)
dbulic opened this issue · comments
Damir Bulic commented
I can't find a way to do equivalent of ruby's
= succeed "." do
%strong last words of a sentence
= surround '(', ')' do
%strong something inside parens
http://haml.info/docs/yardoc/Haml/Helpers.html
Is this supported?
Arnaud Le Blanc commented
Not yet :)
This kind of things should be the responsibility of the target language (Twig or PHP). Translating this syntax to Twig/PHP is not obvious however, as there is no anonymous functions (Twig), or no short syntax for anonymous functions.
Alternatives:
Using "<":
-# The "<" tells HAML not to output whitespaces before/after the strong tag
%strong< last words of a sentence
.
Using inline HTML:
<strong>last words of a sentence</strong>.