microsoft / AdaptiveCards

A new way for developers to exchange card content in a common and consistent way.
https://adaptivecards.io
MIT License
1.71k stars 542 forks source link

[Authoring] Unable to render code within adaptive card #8836

Open sandeepvootoori opened 4 months ago

sandeepvootoori commented 4 months ago

Target Application

Teams

Application Operating System

Windows

Schema Version

1.5

Problem Description

I have the below adaptive card and it doesnt render the code correctly? When not using Adaptive Cards, teams is able to process this and render everything inside code block as code block.

Expected Outcome

Render the code block as code block

Actual Outcome

Code block is being rendered as regular text

Card JSON

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "text": "Sure! Here's an example of code to add two numbers in Python:\n\n\nnum1 = 5\nnum2 = 10\n\nsum = num1 + num2\n\nprint(\"The sum of\", num1, \"and\", num2, \"is:\", sum)\n\n\nThis code declares two variables `num1` and `num2` with values 5 and 10 respectively. It then adds the two numbers together and stores the result in the variable `sum`. Finally, it prints the sum to the console.",
            "wrap": true
        }
    ],
    "msteams": {
        "width": "Full"
    },
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.5"
}

Repro Steps

No response

sandeepvootoori commented 4 months ago

ACE.txt Attaching the JSON in a txt file, github is changing the format