Radek
Radek

Reputation: 11121

how to include 5 <BR>'s in Haml?

this code

= 5.times {|n| puts "<BR>"}

does nothing for me ...

Upvotes: 11

Views: 18485

Answers (4)

Oriol
Oriol

Reputation: 12720

You can also insert regular html.

Like this:

%p
  Headline
  <br><br><br><br><br>
  Paragraph goes here, blah blah blah...

Or like that:

:plain
  <br><br><br><br><br>

Upvotes: 1

Brian Deterling
Brian Deterling

Reputation: 13734

Another way:

= "<br/>"*5

Upvotes: 10

Jeremy Weiskotten
Jeremy Weiskotten

Reputation: 978

- 5.times do
  %br

Upvotes: 40

Joshua Smith
Joshua Smith

Reputation: 6631

You can use % to specifically add a tag. So, for 5
do

%br/
%br/
%br/
%br/
%br/

But: why would you want to do this? It would probably be a better idea to use a %div and set the spacing in CSS rather than multiple BR tags.

Upvotes: 2

Related Questions