9

Yeah so the title pretty much sums it up. How do you do it!?

I write my text as:

 lorem ipsum %strong Banana republic bla bla bla

wanting to bold the 'Banana republic' part. But the %strong just gets printed out on the screen like it's part of the body text...

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
  • I'm not sure if I'm up to date, but what I know: http://chriseppstein.github.io/blog/2010/02/08/haml-sucks-for-content/ – Robin Jan 15 '14 at 10:09

5 Answers5

17

HAML utilize indents and line breaks, while reading your code. So you would have to do something like:

%p
  lorem ipsum 
  %strong
    Banana republic
  bla bla bla

This question is similar: inline tag in haml

You could use filters to make this more 'ergonomic': http://haml.info/docs/yardoc/file.REFERENCE.html#filters

Here an example:

%p
  :markdown
    lorem ipsum *Banana republic* bla bla bla

By default the html filter is applied, so the following would work too:

%p
  lorem ipsum <strong>Banana republic</strong> bla bla bla
Community
  • 1
  • 1
Robin
  • 8,162
  • 7
  • 56
  • 101
4

Haml is not convenient in such cases. Something like this should work:

lorem ipsum
%strong Banana republic 
bla bla bla
Jacek
  • 412
  • 4
  • 9
2

Try: http://www.htmltohaml.com/

lorem ipsum
%strong Banana republic
bla bla bla
shweta
  • 8,019
  • 1
  • 40
  • 43
1

If all that you need is a rich text formatting - consider using :markdown or :textile haml filters.

http://haml.info/docs/yardoc/file.REFERENCE.html#markdown-filter

http://haml.info/docs/yardoc/file.REFERENCE.html#textile-filter

Alexander Tokarev
  • 2,743
  • 2
  • 20
  • 21
0

try this

lorem ipsum
%strong Banana republic
bla bla bla
Nitin Jain
  • 3,053
  • 2
  • 24
  • 36