Peter
Peter

Reputation: 132157

Using HAML elements inside a block of text

I often want some html like this:

(<span id="items_shown">all</span> items shown)

which I end up getting by using haml like this:

%span><
  (
%span#items_shown><
  all
%span
  items shown)

Note that I end up having to create extra spans, and then having to control for the whitespace around those spans, in order to get the exact syntax that I want, without extra spaces between the first ( and the all.

So here's the question. What's the best way of having the exact html above, to display (all items shown) with all in a span? Is there something more elegant than my haml?

Upvotes: 2

Views: 2011

Answers (1)

Natalie Weizenbaum
Natalie Weizenbaum

Reputation: 5964

Check out the FAQ to this effect. The short answer is that Haml's not optimized for inline markup, and there's no shame in just using HTML if you need to.

Upvotes: 4

Related Questions