Closed grwllrnc closed 1 month ago
I'm also facing this issue.
I'd like to thank the OP for pointing out that I can get around it by using the blogPost.post.content field, I was tearing my hair out trying to figure out why it was only returning the first <p>
tag's contents. I will do this as a workaround until the content_html tag is fixed.
Fixed in e635f52d2b389bf6b9bcc2e5711bf399614f5a09
Hi there,
We are using Rainlab’s blog plugin v1.7 with October 3.5.15 resp. 3.6.30 and the ‘Force the WYSIWYG editor’ option activated in the settings.
While writing new blog posts we encountered the problem that only the first HTML tag of the Richeditor content gets displayed in the front end. The rest of the content is chopped off.
A look in the database table
rainlab_blog_posts
shows, that the fieldcontent
contains the entire HTML content inserted in the backend. While the fieldcontent_html
contains only the first HTML tag of thecontent
field.The model
Post.php
is parsing thecontent
withMarkdown::parse()
before inserting the result into the database fieldcontent_html
.Apparently, the markdown parser chops off the content after the first HTML tag.
If I hand over the Richeditor content without the
Markdown::parse()
in line 213, like thisit gets displayed correctly.
Or if I wrap the Richeditor content in line 142 in a single
div
tag like thisor manually in the Richeditor source view it self, the content gets displayed correctly too.
Our Richeditor wraps every thing into
<p>
tags except for some excluded tags, and these<p>
tags do not have parents only siblings.Is this a bug? Or is our integration not correct?
Thanks in advance for your reply.