MicrosoftDocs / msteams-docs

Source for the Microsoft Teams developer platform documentation.
https://aka.ms/teamsdev
Creative Commons Attribution 4.0 International
281 stars 502 forks source link

Different escape strategies and italic interpretation (on different operation systems and AdaptiveCard elements) #5793

Open sueess opened 2 years ago

sueess commented 2 years ago

Hi there

I know the title is hard to understand, but it exactly shows the mess :). Let's start with the problems:

  1. In the documentation it says to use italic to display text italic. On some devices/OS this italic also works. On some others it does not. This is very problematic, since we can not distinguish between OS when we send a message. Solution: Make the interpretation everywhere the same.
  2. Since the is still working on some devices, we are escaping it like this \. Like this we get also different representations. Android an iOS show the backslash, OSX and Windows not. Solution: Make the interpretation everywhere the same.
  3. The Markdown is not working consistently in all AdaptiveCard selectors. E.g. in Input.ChoiceSet the Markdown is not accepted. Why not just making things consistent in all elements? Solution: Make the interpretation everywhere the same.

In short: Please ensure that Markdown and Escaping works on all devices, AdaptiveCard elements and OS the same way

macOS android iOS-mobile Windows .

ghost commented 2 years ago

Hi sueess! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

sayali-MSFT commented 2 years ago

@sueess -We are looking into this I will get back to you soon.

sayali-MSFT commented 2 years ago

@sueess -We are tried to repro the scenario with IOS and android device but markdown is working fine in both. Could you please confirm with which device getting issue? IOS Device - MicrosoftTeams-image (27) Android Device - MicrosoftTeams-image (29) Windows:- image

sueess commented 2 years ago

Thanks for looking into that problem. We tested again and here is the most actual documentation. I hope it is understandable.

*Adaptive card using markdown for italic**

{
  type: 'AdaptiveCard',
  body: [
    {
      type: 'TextBlock',
      text: 'Text with stars to make it italic: *text*',
      wrap: true
    },
    {
      type: 'TextBlock',
      text: 'This is a *. Sometimes we like to use a * in the text, or in the middle of a wor*d.',
      wrap: true
    },
    {
      type: 'Input.ChoiceSet',
      id: 'multipleCardSelection',
      style: 'expanded',
      choices: [
                { 
                    title: 'Text with stars to make it italic: *text*', 
                    value: 1
                },
            {
                title: 'This is a *. Sometimes we like to use a * in the text, or in the middle of a wor*d.',
                value: 2
            }
      ],
      isMultiSelect: true,
      wrap: true
    }
  ],
  actions: [],
  '$schema': 'http://adaptivecards.io/schemas/adaptive-card.json',
  version: '1.4'
}

mobile windows

*Adaptive card using in text**

{
  type: 'AdaptiveCard',
  body: [
    {
      type: 'TextBlock',
      text: 'Text with stars to make it italic: \\*text\\*',
      wrap: true
    },
    {
      type: 'TextBlock',
      text: 'This is a \\*. Sometimes we like to use a \\* in the text, or in the middle of a wor\\*d.',
      wrap: true
    },
    {
      type: 'Input.ChoiceSet',
      id: 'multipleCardSelection',
      style: 'expanded',
      choices: [
            { 
                    title: 'Text with stars to make it italic: \\*text*', 
                    value: 1
                },
            {
                title: 'This is a \\*. Sometimes we like to use a \\* in the text, or in the middle of a wor\\*d.',
                value: 2
            }
      ],
      isMultiSelect: true,
      wrap: true
    }
  ],
  actions: [],
  '$schema': 'http://adaptivecards.io/schemas/adaptive-card.json',
  version: '1.4'
}

MicrosoftTeams-image (1) MicrosoftTeams-image

sayali-MSFT commented 2 years ago

@sueess -Currently markdown feature supports TextBlock. TextBlock offers advanced features for formatting and localizing the text. https://docs.microsoft.com/en-us/adaptive-cards/authoring-cards/text-features#markdown-example

markdown

sueess commented 2 years ago

I know that - I'm reading the doc. In German language we need sometime to use the *. Since it is interpreted as markdown, we have to escape using backslackes. And that is not displayed the same way on mobile and desktop. Don't you see that difference? That's a clear bug: Bildschirmfoto 2022-04-28 um 12 37 51

If you don't see the bug, then let me know how I can escape a * reliable on all devices. Thank you!

sayali-MSFT commented 2 years ago

@sueess -ok Got it. We are able to repro that issue , We have raised bug for the same and concerned team is looking into it. We will inform you once we get any update.

sueess commented 2 years ago

Nice! Thank you!

sueess commented 2 years ago

Is there any update?

sayali-MSFT commented 2 years ago

Engineering team working on this issue. Currently we don’t have ETA or Update on this thread. We will update this thread once the bug is fixed.

sayali-MSFT commented 2 years ago

Engineering team working on it will take time to rolled out publicly. We will update this thread once publicly available.

MajaEffenberg commented 1 year ago

Is there any update for this bug? We still have this problem, that Markdown and Escaping is displayed in different way on different devices.

The same Adaptive Card displayed in Microsoft Teams Windows App and Android App: image-20221102-075606 Screenshot_20221102_085330 (1)

sayali-MSFT commented 1 year ago

@MajaEffenberg -Issue is solved on latest canary build. We will update you once it is publicly released.

sayali-MSFT commented 11 months ago

Sorry for delay in response!! We are actively checking the status of bug with engineering team and let you know the updates, if we have any.

botch8 commented 10 months ago

Is there an update on this? We are hitting this as well.

I'm trying to have my bot just return tst, It works fine on Desktop and Web but on mobile i get italics, even when i surround it with ticks. I've even tried RIchTextBlocks, nothing stops the mobile app from applying markdown formatting.

image

sayali-MSFT commented 10 months ago

@MajaEffenberg @botch8 -Hope you are doing well!! Just wanted to inform you that engineering team is working on this issue, and we are tracking it closely. Once we get any update on it, we will inform you accordingly.

sschoeb commented 7 months ago

@sayali-MSFT The engineering team is now working for 3 months on this. Do you have any additional information on this?

Prasad-MSFT commented 2 days ago

@sueess, we got below update from engineering team:

  1. By spec, Adaptive Card only supports Markdown for TextBlock and Fact / FactSet, while the other fields should remain pure text. So, for MultiChoice there's no need to escape markdown but just keep text straightforwardly. image (Same behaviour in Desktop/Web and Mobile clients)

  2. For escaping in Markdown in TextBlock: image (Same behaviour in Desktop/Web and Mobile clients)