Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helpers (succeed, surround etc.) #52

Open
dbulic opened this issue Jan 31, 2014 · 1 comment
Open

Helpers (succeed, surround etc.) #52

dbulic opened this issue Jan 31, 2014 · 1 comment
Labels

Comments

@dbulic
Copy link

dbulic commented Jan 31, 2014

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-lb
Copy link
Owner

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>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants