Allow block html to render all fields#27
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds UNSAFE_HTML_BLOCKS config and Decidim::ContentBlocks::HtmlCell to conditionally render HTML content unsanitized when enabled; includes tests for both modes, README documentation, and test environment config updates. ChangesHTML Block Rendering with Configurable Sanitization
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@spec/cells/decidim/content_blocks/html_cell_spec.rb`:
- Around line 15-16: Add a spec that exercises the actual env-to-boolean parsing
for Decidim::Pokecode.allow_html_blocks instead of stubbing the accessor: write
two examples that (1) ensure when ENV['ALLOW_HTML_BLOCKS'] is unset or blank the
method returns the default/false, and (2) ensure when ENV['ALLOW_HTML_BLOCKS'] =
"false" the method returns false. Implement these by temporarily setting ENV (or
using ClimateControl.modify) around the expectation and reloading or
re-evaluating Decidim::Pokecode.allow_html_blocks so the real parser runs
(referencing Decidim::Pokecode.allow_html_blocks in your examples).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6b9db855-a167-4377-bc9c-453653ab09cb
📒 Files selected for processing (6)
.github/test-env-configs.jsonREADME.mdapp/cells/decidim/content_blocks/html_cell.rblib/decidim/pokecode/configuration.rbspec/cells/decidim/content_blocks/html_cell_spec.rbspec/lib/version_spec.rb
microstudi
left a comment
There was a problem hiding this comment.
Looks good, but we need to change the variable name, check the comment.
Also, add the HtmlCell.rb to the https://github.com/openpoke/decidim-module-pokecode/blob/main/spec/lib/overrides_spec.rb file!
🎩 What? Why?
This PR overrides the recent versions of Decidim, which have made Block HTML pretty useless.
📌 Related Issues
Link your PR to an issue
Related to #?
Fixes #26
Summary by CodeRabbit
New Features
Documentation