Skip to content

Triple-stash & HTML tags in string #446

Closed

Description

Hi, I have a piece of json data, which contains html tags as string:

{"key" : "<p>this is the data</p><br><ul><li>This is the list-item</li></ul>"}

I use handlebars to get the data. The ideal output should be:

This is the data

  • This is the list-item

I used {{key}} at first, but the output contains the html tags as plain text:

<p>this is the data</p><br><ul><li>This is the list-item</li></ul>

In the end, the triple stash {{{key}}} helped me solve the problem and achieved the ideal output. However, I have no idea why it works. Could someone please explain the reason behind to me? Thank you in advance.

Activity

  1. huideaki commented on May 6, 2021

    @huideaki

    https://handlebarsjs.com/guide/expressions.html#html-escaping

    The explaination should be what u are looking for here

  2. locked and limited conversation to collaborators on Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions