fix(blog): encode XML special characters in RSS feed title and descri…#198
fix(blog): encode XML special characters in RSS feed title and descri…#198scosman merged 2 commits intoscosman:mainfrom
Conversation
WalkthroughThe updates modify how page titles are extracted from HTML and enhance XML entity encoding in the blog RSS feed. The first change switches from using Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/lib/build_index.ts (1)
39-41: Switch totextContentfor robust title extraction.Using
textContentinstead ofinnerHTMLcorrectly strips out HTML tags and prevents markup from polluting your search index. Consider adding a.trim()to remove any incidental whitespace around the title.src/routes/(marketing)/blog/rss.xml/+server.ts (1)
20-23: EscapeblogInfofields in RSS feed withencodeXML.Applying
encodeXMLto<title>and<description>ensures special characters are properly escaped in the XML output. Nice work! Optionally, you could migrate this manual string‐concatenation into a small XML-builder utility to improve maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/lib/build_index.ts(1 hunks)src/routes/(marketing)/blog/rss.xml/+server.ts(1 hunks)
|
Thanks! |
fix(blog): encode XML special characters in RSS feed title and descri…
fix(blog): encode XML special characters in RSS feed title and descri…
…ption for proper formatting
Fixed character encoding for blog, RSS XML was failing for special characters in blog title/description.
Fixed search results showing & instead of & in titles. The issue was that the search index used the raw HTML content when building, but we should use textContent
Blog issue fixed:

Search issue fixed:

Summary by CodeRabbit