I'm using Lexxy in a Ruby on Rails project, and I found that the editor sends unwanted HTML even when no content is entered.
Environment
- Ruby: 3.4.7
- Rails: 8.1.1
- Lexxy: 0.1.20.beta
Setup
Post model has body in ActionText format.
Problem
When I submit the form without typing anything in the Lexxy editor, the params already contain <p><br></p> instead of an empty string.
Here’s the captured params:
#<ActionController::Parameters {
"authenticity_token" => "TOKEN",
"post" => {"title" => "", "body" => "<p><br></p>"},
"lexxy-code-language" => "plain",
"commit" => "Create Post",
"controller" => "posts",
"action" => "create"
} permitted: false>
Expected behavior
If the editor is empty, I expect params[:post][:body] to be an empty string (""), not <p><br></p>.