3

I can do a div tag like this:

2.1.0 :014 > Arbre::Context.new { div "foo" }
 => <div>foo</div>

And a span tag like this:

2.1.0 :017 > Arbre::Context.new { span "foo" }
 => <span>foo</span>

But this convention doesn't work for the p (paragraph) tag:

2.1.0 :020 > Arbre::Context.new { p "foo" }
"foo"
 =>  

Obviously this doesn't work because p is already used in Ruby.

How do I do a paragraph tag in Arbre?

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98

1 Answers1

4

In Arbre, the paragraph function is para:

2.1.0 :021 > Arbre::Context.new { para "foo" }
 => <p>foo</p>

I was not able to find this in any docs. I just got lucky.

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
  • This makes sense, wouldn't want to override [Kernel#p](https://ruby-doc.org/core-2.4.0/Kernel.html#method-i-p) – Nic Jan 25 '17 at 16:12