Strip nested page context markers from standalone RenderShortcodes#14733
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
There was a problem hiding this comment.
Pull request overview
Fixes nested page context marker artifacts leaking into output when calling .RenderShortcodes in a standalone context (i.e., not followed by Goldmark rendering), addressing #14732.
Changes:
- Added a reusable
hugocontext.Striphelper to remove__hugo_ctxmarkers from byte slices. - Updated
.RenderShortcodesto strip context markers when not running inside Goldmark. - Added an integration test to ensure standalone
.RenderShortcodesoutput contains no__hugo_ctxartifacts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| markup/goldmark/hugocontext/hugocontext.go | Introduces Strip to remove Hugo context markers from rendered output. |
| hugolib/page__content.go | Applies hugocontext.Strip when .RenderShortcodes is executed outside Goldmark. |
| hugolib/rendershortcodes_test.go | Adds regression coverage for standalone .RenderShortcodes (Issue #14732). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes gohugoio#14732 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes #14732
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com