Skip to content

nav-item: wire the raw argument through from the shortcode #2126

Description

@markdumay

assets/nav-item.html already accepts a raw field that bypasses Page.RenderString for a tab-pane body, but layouts/_shortcodes/nav-item.html never passes it and no caller in the module sets it — so the field is unreachable from markdown.

That matters on any site running markup.goldmark.renderer.unsafe = false. A nav-item whose body is a single nested shortcode emitting raw HTML (a grid, a chart, a custom table) reaches RenderString as literal raw HTML, and CommonMark then comments out or garbles the block. The pane renders as escaped text instead of the component.

Suggested fix, matching the existing $parentFade pattern in the same file (so a real false is not clobbered by | default):

{{- $raw := false -}}
{{- if and .IsNamedParams (isset .Params "raw") }}{{ $raw = partial "utilities/CastBool.html" (.Get "raw") }}{{ end -}}

then pass "raw" (cond $raw $body "") in both partial "assets/nav-item.html" calls (the tab output and the accordion alternative). Opt-in and defaulting to false, so every existing call site is unaffected — "" is falsy in the or that selects the body.

Verified working against v3.16.3 as a local override on a downstream site, where it is carried as an explicit interim fork pending this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions