microsoft / microsoft/AdaptiveCards

[Rendering] CodeBlock doesn't work in new teams.

Open
#8,927 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Renderers Bug
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Target Platforms

Other

SDK Version

don't know

Application Name

Microsoft Teams (macOS)

Problem Description

I'm trying to push a message via Webhook. And that should be a "CodeBlock". My Input is

{
   "type" : "message",
   "attachments" : [
      {
         "content" : {
            "$schema" : "http://adaptivecards.io/schemas/adaptive-card.json",
            "body" : [
               {
                  "codeSnippet" : "Date: Mon, 10 Jul 2023 11:54:21 +0200\nMIME-Version: 1.0\nSubject: NEW PRIIP Product setup ISIN:DE000UL45BE5 (Deadline 2023-07-10 13:52)",
                  "type" : "CodeBlock"
               }
            ],
            "type" : "AdaptiveCard",
            "version" : "1.5"
         },
         "contentType" : "application/vnd.microsoft.card.adaptive",
         "contentUrl" : null
      }
   ]
}

which I send via a POST-Request.

In Teams classic the result looks OK:
Screenshot 2024-05-29 um 16 34 03
In the new Teams it does not:
Screenshot 2024-05-29 um 16 33 31

Maybe the CodeBlock is broken in new teams?

Screenshots

No response

Card JSON
{
            "$schema" : "http://adaptivecards.io/schemas/adaptive-card.json",
            "body" : [
               {
                  "codeSnippet" : "Date: Mon, 10 Jul 2023 11:54:21 +0200\nMIME-Version: 1.0\nSubject: NEW PRIIP Product setup ISIN:DE000UL45BE5 (Deadline 2023-07-10 13:52)",
                  "type" : "CodeBlock"
               }
            ],
            "type" : "AdaptiveCard",
            "version" : "1.5"
         }
Sample Code Language

No response

Sample Code

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the supplied Adaptive Card JSON and webhook request as the reproduction input; compare CodeBlock rendering in Teams classic and new Teams. Confirm whether the discrepancy is reproducible in the Adaptive Cards implementation or is specific to the Teams host, then document the resulting behavior or fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.