In the rdoc there's an example:
xml.em { xml.b("emp & bold") }
Which produces:
<em><b>emph & bold</b></em>
But what if I wanted to nest tags with text, i.e.:
<em>just emph and <b>emph & bold</b></em>
?
I've messed around with it and have only gotten bizzare results or
nothing displayed at all - any help appreciated - thanks
--
Posted via http://www.ruby-forum.com/.
On Thu Jun 29, 2006 at 12:25:07AM +0200, brez! !! wrote:> In the rdoc there's an example: > > xml.em { xml.b("emp & bold") } > > Which produces: > > <em><b>emph & bold</b></em> > > But what if I wanted to nest tags with text, i.e.: > > <em>just emph and <b>emph & bold</b></em> > > ?are you really making xml? or just abusing it to make HTML. if its the latter, try markaby: em do text "just emph and" b "emph & bold" end> > I've messed around with it and have only gotten bizzare results or > nothing displayed at all - any help appreciated - thanks > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
> are you really making xml? or just abusing it to make HTML. if its the > latter, try markaby: > > em do > text "just emph and" > b "emph & bold" > endYea I'm really making XML - it's actually docbook so I want to able to do something like: <para> Some text and then an inline <quote>word</quote> that appears in quotes. </para> -- Posted via http://www.ruby-forum.com/.
answer:
xml.em {
xml.text! "just emph and"; xml.b("emp & bold");
}
and
xml.para {
xml.text! "Some text and then an inline";
xml.quote("word"); xml.text!
"appears in quotes."
}
--
Posted via http://www.ruby-forum.com/.