Closed djflorio closed 8 years ago
That's probably your browsers doing. I'd suggest dropping the wrapping p-tag.
Thanks for the reply. It looks like I can achieve what I want by using span instead of p, which results in:
<span class = "styled text"><div>Dynamically added text</div></span>
This still seems a little strange to me, though. Why the added div tags? This happens on both Chrome and Firefox (the extra div tags and the splitting up of p tags).
It's how Trix (the editor we use in Spina) handles rich text.
Ok got it, thanks. So if I want raw text, I should just use Spina::Line?
Yes!
It appears that Spina::Text objects are automatically wrapped in div tags and break whatever tags they are injected into. For example, if I have:
<p class = "styled-text"><%= @page.content(:text).try(:html_safe) %></p>
The resulting HTML for the page becomes:
<p class = "styled-text"></p><div>Dynamically added text</div><p></p>
Is there any particular reason why this happens?
P.S. really enjoying this CMS. Great work.