I have problem with markdown formatting of Text property in Hero card. Here is code sample:
HeroCard heroCard = new HeroCard()
{
Text= $"**Place1**: Berlin \n\n**Place2**: Hamburg",
Buttons = cardButtons
};
It doesn't make line brakes. Also tried \r\n, works neither. It looks like this:
How can I put text on the bottom of the hero card?
With Markdown, you get a live preview of your formatted text inside your compose box as you type, and you can always undo your formatting by pressing Ctrl+Z.
To include a mention in an Adaptive Card, your app needs to include the following elements: <at>username</at> in the supported Adaptive Card elements. The mention object inside of an msteams property in the card content includes the Teams user ID of the user being mentioned.
The formatting elements specified by Markdown come in two basic types: there are block elements and inline elements. Block elements include such things as paragraphs of text, code blocks, block quotes, lists, and tables.
Media elements are currently not supported in Adaptive Card on the Teams platform.
As already mentioned, this is down to both the channel (client - e.g. emulator, skype, facebook, your own directline client) implementing markdown support, since the text is sent as markdown in the json response.
However, at the moment you'll probably find that both the emulator and skype will render markdown on the message's "text" element but will ignore markdown on the attachment's "text" elements, e.g.
HeroCard heroCard = new HeroCard()
{
Text= "Booo - no *markdown* supported here",
Buttons = cardButtons
};
vs
var reply = activity.CreateReply("**Lovely lovely markdown**\n\n *yey!*");
var heroCard = new HeroCard()
{
Text = "Booo - no *markdown* supported here",
Buttons = cardButtons
};
reply.Attachments = new List<Attachment> {
hero.ToAttachment()
};
I show a few examples of rich conversation cards here, and how they render on emulator vs skype desktop vs skype app va skype web, in case that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With