Skip to content

Strip nested page context markers from standalone RenderShortcodes#14733

Merged
bep merged 1 commit into
gohugoio:masterfrom
bep:fix/issue-14732
Apr 7, 2026
Merged

Strip nested page context markers from standalone RenderShortcodes#14733
bep merged 1 commit into
gohugoio:masterfrom
bep:fix/issue-14732

Conversation

@bep

@bep bep commented Apr 7, 2026

Copy link
Copy Markdown
Member

Fixes #14732

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

@gemini-code-assist

Copy link
Copy Markdown
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Strip helper to remove __hugo_ctx markers from byte slices.
  • Updated .RenderShortcodes to strip context markers when not running inside Goldmark.
  • Added an integration test to ensure standalone .RenderShortcodes output contains no __hugo_ctx artifacts.

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.

Comment thread markup/goldmark/hugocontext/hugocontext.go
Fixes gohugoio#14732

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bep bep force-pushed the fix/issue-14732 branch from ef35f00 to 621d6cc Compare April 7, 2026 16:31
@bep bep merged commit 45e4596 into gohugoio:master Apr 7, 2026
6 checks passed
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.

Don't apply nested page context handling to standalone .RenderShortcodes

2 participants