Hassen
Hassen

Reputation: 7664

Haml: Avoid extra-space when word wrapping

When I use Haml in my Rails view, word wrapping (especially to add italic or strong effect) display is rendered as a space. For example:

%p
    Click on "
    %em New Product
    " to add a product in your catalog.

Displays Click on " New Product " to add a product in your catalog. which contains extra spaces inside quotes.

Any idea? Thanks in advance.

Upvotes: 1

Views: 529

Answers (2)

Mik
Mik

Reputation: 4187

Another, more readable solution:

%p
  Click on "<em>New Product</em>" to add a product in your catalog.

Upvotes: 1

Michael
Michael

Reputation: 548

Write this way.

%p
  Click on "
  %em> New Product
  " to add a product in your catalog.

More.

Upvotes: 4

Related Questions