🐛 Fixed design preview showing raw markdown when llms.txt is enabled#28266
Conversation
fixes TryGhost#28265 - the design & branding and announcement bar previews fetch the page, read it as text, and re-parse it as HTML into the iframe — they have always sent `Accept: text/plain` purely as a "give me the raw body" signal, which the frontend ignored - the llms.txt feature added Accept-based content negotiation that now treats `text/plain` as a request for the markdown variant, so with labs.llmsTxt enabled these previews received markdown and rendered it as garbled text - the previews genuinely want HTML, so they now ask for `text/html` instead of accidentally opting into markdown content negotiation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR fixes a bug where markdown was being returned in design previews instead of HTML when the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
fixes #28265
Accept: text/plainpurely as a "give me the raw body" signal, which the frontend ignoredtext/plainas a request for the markdown variant, so with labs.llmsTxt enabled these previews received markdown and rendered it as garbled texttext/htmlinstead of accidentally opting into markdown content negotiationGot some code for us? Awesome 🎊!
Please take a minute to explain the change you're making:
Please check your PR against these items:
We appreciate your contribution! 🙏