Skip to content

Custom-API: Allow raw HTML to be loaded in a template #996

@Stitch10925

Description

@Stitch10925

Description

I am pulling page contents from multiple sources that I would like to bundle on a single page as a dashboard. The source returns JSON with a body parameter containing HTML, which I would like to output on the page.

However, the HTML is always escaped and thus rendered as text instead of added to the DOM as normal HTML.

I tried {{ .JSON.String "page.body" | raw }}, {{ .JSON.String "page.body" | html }}, wrapping in div <div>{{ .JSON.String "page.body" }}</div>, but I can't get it to render the HTML.

It would be nice to have a function that does not escape the content.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions