Andrew Burleson dijo [Thu, Dec 16, 2010 at 09:18:47PM -0800]:
> Here's what I *want*
> 
> .fooclass
>     This is some text that I want inside this div. <br />
>     Because there's going to be some wrapping going on I want to
> control where line breaks are rendered. <br />
> 
> Now, sticking those br tags doesn't do anything obviously.
> 
> If I put
> .fooclass
>     Line one goes here
>     %br Line two goes here
>     %br Line three goes here
> 
> ... then it *kinda* works, but it's rendering like this: "<br>Line two
> goes here</br>" ... which is totally bogus.
> 
> I can put
> .fooclass
>     Line one
>     %br/
>         Line Two
>     %br/
>         Line Three
> 
> ... but I'd hardly call that Markup Haiku!!

First of all: Don't worry on where the <br/> appears on the rendered
HTML. It will work fine.

Second: <br/> is one of several "strange" tags which are meant to be
empty - that's what the final '/' means in XML: Don't expect a closing
tag for this.

You can, as suggested, include the '<br/>' as part of your text - but
I agree, that's not what I have in mind when using HAML. But:

.fooclass
  Line one
  %br
  Line two
  %br
  Line three

renders:

<div class='fooclass'>
  Line one
  <br />
  Line two
  <br />
  Line three
</div>

Greetings,

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to