Skip to content

Sanitize blog summaries with plainify and truncate#454

Open
vittorio88 wants to merge 1 commit intodevcows:masterfrom
lagobello:fix/sanitize-summaries
Open

Sanitize blog summaries with plainify and truncate#454
vittorio88 wants to merge 1 commit intodevcows:masterfrom
lagobello:fix/sanitize-summaries

Conversation

@vittorio88
Copy link
Contributor

@vittorio88 vittorio88 commented Mar 15, 2026

Summary

  • Applies | plainify | truncate to .Summary in recent_posts.html (150 chars) and list.html (300 chars)
  • Raw .Summary can emit HTML tags into card previews and list pages, breaking the layout with unclosed tags or unexpected markup
  • plainify strips HTML, truncate ensures consistent card heights

Test plan

  • Create a blog post with rich HTML content (images, links, bold text, code blocks)
  • Verify the homepage "Recent Posts" section shows clean plain-text previews (no HTML leaking)
  • Verify the blog list page (/blog/) also shows clean summaries

🤖 Generated with Claude Code

Raw .Summary can emit HTML tags into card previews and list pages,
breaking layout. Apply plainify | truncate to strip tags and limit
length: 150 chars for homepage recent posts, 300 for list pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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