Skip to content

Conversation

@jdhollis
Copy link

Hi, all.

I’ve been building a new product, and I want to use Lexxy as my default rich text editor.

I’m encrypting almost everything in my app by default, but it seems the temporary rendering method did not support encrypted ActionText fields.

I know this will likely be sorted upstream once ActionText supports adapters, but in the meantime, I need Lexxy to work with encrypted fields.

Switching to to_html seems to work, and the test suite is all green. I’ve added one test to explicitly hit the encrypted field path. Otherwise, I’m not entirely certain what other tests would be valuable here. (I was mostly concerned whether I broke attachment functionality.)

This commit can likely be trimmed down if we don’t need to do testing beyond the fact that Lexxy can handle encrypted fields.

Also, not sure how to handle encryption-related secrets in a friendly manner for testing purposes in this context. Hard-coding in config/application.rb offends my sensibilities. But this feels like a higher-level CI decision beyond the scope of this PR.

Your feedback is welcome.

Copy link
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jdhollis thanks for reporting the issue.

I am fine with using to_html here. I think I originally went with the before_type_cast approach to skip any rendering on the action text side, but doing body.to_html won't do any action text transformation and is a better option indeed 👍.

I am not interested in adding tests here for the encryption path. As you say, this will be supported out of the box when we move to the rails adapter, and I feel like the encryption testing does't belong here.

Would you mind to rebase and stripe this PR down to just the HTML change? As long as the suite passes we are good to merge.

Thanks

@jdhollis jdhollis force-pushed the add-encrypted-rich-text-support branch from 7eb09c0 to fd10e80 Compare January 5, 2026 20:56
@jdhollis
Copy link
Author

jdhollis commented Jan 5, 2026

Done. Everything via env RAILS_ENV=test bin/rails test:all -d is all green on my end.

@jdhollis jdhollis requested a review from jorgemanrubia January 5, 2026 20:58
@jdhollis
Copy link
Author

jdhollis commented Jan 5, 2026

Actually, hold up. Haven’t rebased off the latest main. 😅

@jdhollis jdhollis force-pushed the add-encrypted-rich-text-support branch from 5abaf10 to 6216f25 Compare January 5, 2026 21:10
@jdhollis
Copy link
Author

jdhollis commented Jan 5, 2026

Alright. Rebased. Everything still green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants