Skip to content

fix: render head_html as safe HTML#623

Draft
gajjug004 wants to merge 1 commit into
frappe:developfrom
gajjug004:fix/wiki-head-html
Draft

fix: render head_html as safe HTML#623
gajjug004 wants to merge 1 commit into
frappe:developfrom
gajjug004:fix/wiki-head-html

Conversation

@gajjug004
Copy link
Copy Markdown
Collaborator

@gajjug004 gajjug004 commented May 13, 2026

Summary

Restore | safe filter on head_html in wiki layout. Without it Jinja autoescapes the snippet, so analytics <script> tags render as text and never execute
ref: be6d8fc

Summary by CodeRabbit

Bug Fixes

  • Improved handling of page header content to ensure metadata and styles render correctly only when present, preventing potential layout issues and improving overall page performance. This fix enhances the reliability and stability of page rendering throughout the application and eliminates unnecessary rendering of empty header content elements.

Review Change Stack

@gajjug004 gajjug004 marked this pull request as ready for review May 13, 2026 04:19
@gajjug004 gajjug004 requested a review from NagariaHussain May 13, 2026 04:19
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 345e7d28-df04-4cfc-9a8a-da0eaff1ed70

📥 Commits

Reviewing files that changed from the base of the PR and between b76af1e and 9effb69.

📒 Files selected for processing (1)
  • wiki/templates/wiki/layout.html

Walkthrough

This PR updates the layout.html template to conditionally render the head_html variable only when it is defined and truthy. The change adds a safe filter ({{ head_html | safe }}) to the rendering expression, which prevents Django from auto-escaping the HTML content. This replaces the previous behavior that always rendered head_html without the conditional guard or the safe filter.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: restoring the safe HTML filter for head_html rendering, which directly addresses the autoescaping issue preventing script execution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gajjug004 gajjug004 marked this pull request as draft May 13, 2026 05:43
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.

1 participant