Open hangsu opened 1 year ago
Hey @hangsu, thanks for bringing this up!
This is indeed something I haven't considered yet, and I'm actually not sure if and how we could support this.
Unless we add a rule that doesn't output the text
call if the method which is being called takes in a block. But I'm not sure if that would be correct in 100% of the cases. Probably not, but it's probably more cases where that would be the more "desirable" outcome.
For the string inside the block we could do something similar as we do with regular HTML elements. Currently this:
<div>123</div>
<div><span>123</span>456</div>
gets converted to:
div { "123" }
div do
span { "123" }
text "456"
end
where we also omit the text
call in the first example if there are other siblings. Maybe we could also do something similar for this case too.
Is your feature request related to a problem? Please describe. Phlexing can't tell when to leave out the
text
method call on methods that renderExpected:
Not sure what the solution might be. Phlexing obviously doesn't know if
c.section
is rendering, capturing forPhlex::DeferredRender
or returning aString
.