Search code examples
microsoft-teamsteams-toolkit

How do I display an ampersand in the appName property of a Teams tab app?


I am developing a Teams tab app, and I am having some difficulty with the "appName" in the manifest. The name of the app is "Stop & Think", but when I generate the manifest using the TeamsFX Toolkit, it generates as "Stop & Think". I have tried a few different iterations with no success. How do I get it to display as a regular & in the appName property?

Tried:

  • & - shows as &
  • & - shows as &
  • & - shows as &
  • escaping the character (not possible in JSON)

Solution

  • I noticed that you open a github issue as well, let's track in there: https://github.com/OfficeDev/TeamsFx/issues/8049, thank you!

    The templates are rendered with mustache.js, and it's HTML-escaped by default. You can use triple {} to avoid this error. E.g. in manifest:

    "name": {
          "short": "{{{config.manifest.appName.short}}}",
          "full": "{{{config.manifest.description.short}}}"
    },