Workaround to Hero Card how to format markdown markdowns?

I know that markdown is supported by the value of the HeroCard text field, although I could not get it to work (tested on MSTeams):

enter image description here

the code

this.bot.dialog("sendCard", (session, args, next) => {
    session.sendTyping();
    const card = new builder.HeroCard(session);

    card.title("Title");
    card.subtitle("Subtitle");
    card.text("This is some *mardown* text! \n\n - one \n\n - two");

    const msg = new builder.Message(session);

    msg.textFormat("markdown");
    msg.attachments([
        card,
    ]);
    session.endDialog(msg);
});

I am wondering how I can achieve this formatting (from the mailclark boot in MSTeams):

enter image description here

As you can see, this is a carousel of what, in my opinion, might be HeroCards, but they are formatted with bold, code, and unordered lists in new paragraphs .

It seems like a known issue is that message attachments don't get formatting, but how can the guys in this community achieve this ?


Edit: An example of an unordered list:
enter image description here

Bold and code example:
enter image description here

+4
source
2

Hero Rich Card, MS Teams https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-conversations#formatting-text-content:

Microsoft Markdown XML (HTML).

Markdown

, MS Teams , HTML Rich Card.

, :

bot.dialog('/', function (session) {
    const card = new builder.HeroCard(session);
    card.title("Type your question to our support team here");
    card.subtitle("Or, click the ◀▶ arrows for a series of how-tos");
    card.images([builder.CardImage.create(session,"<image url>")])
    card.text("<p>This is some <i>mardown</i> <b>text</b>!</p> <ul><li><b>one</b></li><li><code>two</code></li></ul>")
    const msg = new builder.Message(session);
    msg.attachmentLayout(builder.AttachmentLayout.carousel);
    msg.attachments([
        card,card,card
    ]).toMessage();
    session.send(msg);
    session.endDialog("This is some *mardown* **text**! \n\n - **one** \n\n - `two`");
});

MS Team : enter image description here

+3

MailClark . : .

, HTML <code> <strong>.

: HTML, , : ( , <ul><li>).

+1

Source: https://habr.com/ru/post/1690133/


All Articles