MicrosoftDocs / msteams-docs

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

Inline blocks of code (snippets) no longer formattable via keyboard (Markdown backticks) with certain keyboard layouts #9126

Open vancromy opened 1 year ago

vancromy commented 1 year ago

According to MS teams documentation, inline code snippets can be written by enclosing the code with single backticks as is usually done in markdown. This is an example of that implementation.

Multiline code snippets do however still work as can be seen in the attached video below.

The keystrokes I pressed in the following video to try and write an inline code snippet was [backtick]my code[backtick][space]

In my current version of Teams this does not work (see: https://github.com/MicrosoftDocs/msteams-docs/assets/59556820/8b90f413-9adf-466d-9df6-b596bc2d7d4c).

Teams version: You have Microsoft Teams Version 1.6.00.17554. It was last updated on 31/07/2023. OS Info: macOS 13.4.1 (c) (22F770820d)

EDIT: It seems someone opened a FR for this around the same time I opened this issue. Feel free to upvote that one too: https://feedbackportal.microsoft.com/feedback/idea/965f520a-e40c-ee11-a81c-000d3a7a48db

sidbena commented 8 months ago

A small addition here; I noticed that typing shift+alt+´ on my Swedish keyboard on macOS correctly generates an in-line code block, while shift+´ does not. shift+alt+´ seems to generate a U+0060 which after typing two correctly translates to an in-line code block. Perhaps this helps someone.

jesuslopezxing commented 8 months ago

I have noticed that it fails when using Spanish layout on Mac but working fine if using English layout on the same computer and setup.

chabb commented 7 months ago

Same there. It works on US layout, but fails with a swiss french layout. I'm using a Macbook Pro (14.3)

ttonteri commented 7 months ago

I noticed that typing shift+alt+´ on my Swedish keyboard on macOS correctly generates an in-line code block, while shift+´ does not.

Awesome! This really seems to be the only way to reliably get it working. Confirmed on macOS with Finnish keyboard. While the backtick looks exactly the same with shift+´ it requires the additional space and ends up not working. In the terminal window there is a clear difference with the backtick-highlight while waiting for the next input key. Many thanks for sharing! Clearly Teams functionality depends on the exact input key sequence since none of this works when copy-pasted.

Overall a very disappointing issue thread with the "works for us, it's not broken" comments.

vancromy commented 7 months ago

A small addition here; I noticed that typing shift+alt+´ on my Swedish keyboard on macOS correctly generates an in-line code block, while shift+´ does not. shift+alt+´ seems to generate a U+0060 which after typing two correctly translates to an in-line code block. Perhaps this helps someone.

Thanks for the great tip! For me shift+alt+´ (note that you typed an acute accent and not a grave accent) combo did not work. But it got me to look into the difference between grave accents (U+0060 and U+02CB) and acute accents (U+00B4 and U+02CA). The wiki on grave accents article gives some advice on how to generate grave accents on mac keyboards but they did not work for my layout.

The Norwegian keyboard layout (the one I use) has a dedicated key for the acute accent. When using the shift+acute accent combo, my layout generates a U+02CB (grave accent). BUT when I use the option+acute accent combo, I get a U+0060 grave accent and inline code works! So with the dedicated acute accent key on a Norwegian keyboard, I get the following:

(somehow I have not figured out any key combo that generates the U+00B4 acute accent, but I don't personally need that...)

So TLDR, for Mac users with a Norwegian keyboard layout, use the option+´ to use inline code.

And for non-Norwegian keyboard + Mac users, try to figure out how to generate a U+0060 grave accent with your keyboard layout. @ttonteri & @sidbena have confirmed that for Swedish and Finnish layouts the shift+alt+´ combo works.

For clarity's sake, I still think this is a bug in Teams though because whether a U+02CB or U+0060 grave accent is typed, they are both grave accents and should trigger inline code. GitHub markdown and other markdown renderers I use do not prejudice between these two unless the U+02CB is combined with a letter to create an accented letter.

EDIT: Tested the above on:

maehne commented 7 months ago

With a Swiss German keyboard on Linux with Teams running in a Chrome browser, I am not able to generate a grave accent, which is accepted by Teams for formatting inline code snippets. I tried all kind of combinations of modifier keys. Also copying the correct character into Teams doesn't help.

victor-marino commented 7 months ago

I can confirm that simply copying and pasting the correct character doesn't work either.

I'm on a Spanish keyboard, where the Swedish keyboard trick doesn't seem to work. The only think that has worked reliably is the text substitution trick I mentioned here, which is a faster alternative to simply using the emoji & symbols panel.

For whatever reason, it seems that this only works if the character is inserted by either the emoji panel or the text substitution tool.

For instance, if I use my trick to enter the right character (which I know works well), but instead of typing any further I just cut the generated backtick character and then paste it back in place, the inline code snippet will NOT work. I have to leave the generated backtick character as it is, then generate another one to close the snippet. If just 1 of the 2 backticks has been manually entered by me, the inline snippet will not work.

vancromy commented 7 months ago

@maehne @victor-marino I can confirm your reports. I tried changing my keyboard to Swiss German and Spanish and observed the same behaviour you are reporting.

The common theme with your keyboard layouts is that there is no key sequence that will create a U+0060 grave accent. Both your keyboard layouts only create U+02CB grave accents. I also tried pasting in a U+0060 grave accent but that did not work either on all three layouts I tried (Norwegian, Swiss German, Spanish). So that leads me to the following conclusions:

  1. The inline code functionality can only be triggered via a manually entered key sequence (not via paste)
  2. It currently only works (I have tested this only on Mac) if you have a keyboard layout that has a valid key sequence that will generate the U+0060 grave accent.

So I would suggest adding a second Keyboard layout which has a manual key sequence for a U+0060 grave accent and switching between the layouts using the builtin shortcut ctrl + space (for Mac users). Or you can use text substitution/keyboard mapping tools as others have suggested.

kolbasa commented 7 months ago

What we need are not suggestions on how to work around this ourselves, but that someone in the Microsoft team fixes the bug. Slack, for example, does not have this problem.

Chealer commented 7 months ago

@kolbasa this bug was reported 8 months ago. Don't hold your breath. Until Microsoft fixes it, diagnosing the problem helps users cope with it and Microsoft identify the source.

@Nivedipa-MSFT: Please define what you mean by a "feature request". Most people would not consider a request to fix a breakage as a feature request.

pladaria commented 7 months ago

This issue seems to be related with the keyboard layout.

Using v2 web version with a Spanish keyboard layout, the single backtick code text formatting is not working (the backtick key is near the enter) After changing the keyboard layout to US works as expected (the backtick key is near the 1)

As requested by @Chealer: I'm using Linux Mint 21.3 x86_64 (v2 web version) Chrome 124.0.6367.60

ChetanSharma-msft commented 7 months ago

@kolbasa this bug was reported 8 months ago. Don't hold your breath. Until Microsoft fixes it, diagnosing the problem helps users cope with it and Microsoft identify the source.

@Nivedipa-MSFT: Please define what you mean by a "feature request". Most people would not consider a request to fix a breakage as a feature request.

Hello @Chealer - We have informed Engineering team and they are checking on it.

straurob commented 7 months ago

Checking followed by fixing would be even more awesome.

mateusfccp commented 7 months ago

Checking followed by fixing would be even more awesome.

Yeah, they informed the engineering team three times already, but it's not like informing it will magically solve the problem.

Chealer commented 7 months ago

This issue seems to be related with the keyboard layout.

Using v2 web version with a Spanish keyboard layout, the single backtick code text formatting is not working (the backtick key is near the enter) After changing the keyboard layout to US works as expected (the backtick key is near the 1)

This bug is definitely related to the keyboard layout. Thanks for your care, but when you mention that an install is affected, thanks for minimally indicating the operating system.

Again, I recommend retitling this ticket more accurately, with something like "Inline blocks of code (snippets) no longer formattable via keyboard (Markdown backticks) with certain layouts".

rodrigobutta commented 7 months ago

Already 10 months of this issue reported, and still no fix. And for such an used thing (thanks to Slack). Incredible. I think that VSCODE is the only amazing thing that Microsoft has to offer today.

kolbasa commented 7 months ago

I have to use both during the day. Teams and Slack. Inline blocks are so extremely useful, I use them all the time, it's absolutely sad that the bug has been ignored here for so long. This issue report has by far the most comments, people are annoyed.

felixgenicio commented 6 months ago

Just updated Teams and got the "what is new screen"

seriously

Sure adding the touch Airpod touch thing is more important than sharing code for work.... ¬¬

TAC911 commented 6 months ago

A sort of workaround that does the trick for me (German keyboard) for now is to use macOS Text Replacements option in the keyboard settings. I'm replacing a double backtick ` with a single one. When the text replacement is performed I get the inline block.

image

Hoping this helps until we get a fix.

rgisiger commented 6 months ago

A sort of workaround that does the trick for me (German keyboard) for now is to use macOS Text Replacements option in the keyboard settings. I'm replacing a double backtick ` with a single one. When the text replacement is performed I get the inline block.

image

This is the best workaround so far for me at the moment 👍 , even if I decided to replace a double dollar sign $$ instead of a double backtick (``) since using double backtick still require some kind of diacritic confirmation for the sign to appear correctly.

louiswebdev commented 5 months ago

Same problem here, it's annoying the hell out of me. "New" Teams, MacOS 14.x, German keyboard.

straurob commented 5 months ago

@ChetanSharma-msft Your last comment is from two months ago. I suspect there is no update from the engineering team? Honestly, this is so annoying.

ahans commented 5 months ago

Just another data point: For me it does not work on Linux with the us-intl keyboard layout. us is fine. Just now I noticed that it is also broken on macOS with its equivalent of US Intl. layout. My impression was that it is related to dead keys.

It used to work in channels and did not work in private conversations, but some time ago it stopped working in channels as well.

mirupal commented 5 months ago

A sort of workaround that does the trick for me (German keyboard) for now is to use macOS Text Replacements option in the keyboard settings. I'm replacing a double backtick ` with a single one. When the text replacement is performed I get the inline block.

image

Hoping this helps until we get a fix.

:D youre the best. For me no shortcut worked anymore. Single ticks were gone some time ago. Now tripple ticks stopped to work also.

Default german keyboard layout here and its the only thing which works for me. But.. it only worked for me with a small addition:

  1. Hold SHIFT and type ` (press twice)
  2. Now immdiately press AND hold SPACE without releasing SHIFT.

Its the only way I get this code-block

image

Funny enough, for two other people (one on osx on on ubuntu) in our company it didn't work. I assume they are on a different version of Teams.

OSX Sonoma Teams-Version: 24152.405.2925.6762 Client-Version 50/24051622215

mateusfccp commented 5 months ago

It's not a good thing that I was made redundant from my last job, but at least I don't have to use Microsoft Teams anymore.

sattes-faction commented 5 months ago

I'm having the same issue on a German keyboard layout since a few months. And now with the latest teams update where they overhauled the input field and toolbar slightly, they also removed the toolbar option to format text as inline code snippet - that's really ridiculous. As like they don't want programmers to use teams.

negora commented 5 months ago

...they also removed the toolbar option to format text as inline code snippet - that's really ridiculous. As like they don't want programmers to use teams.

Really, such option is now buried in the menu Format -> More options -> Paragraph -> Monospaced . Which sounds like a contradiction, because the Monospaced option affects only the selected text, not the whole paragraph.

In my opinion, it makes no sense that such option is buried there. Nor does it make sense that there isn't at least a keyboard shortcut for this. I would prefer that backticks worked well, but at least with a shortcut I wouldn't need to waste so much time to just format variable names when I communicate with my partners at work.

sattes-faction commented 5 months ago

Oh boy, that's really hidden very well, thanks a lot!

Yes, I agree, the wording is misleading as "paragraph" usually just refers to a plain <p>-like text. And also there is no indication at all that there is actually a submenu hidden beneath that word - no arrow or icon, nothing. UX-wise it's worse than before.

ruben-grossmann commented 5 months ago

...they also removed the toolbar option to format text as inline code snippet - that's really ridiculous. As like they don't want programmers to use teams.

Really, such option is now buried in the menu Format -> More options -> Paragraph -> Monospaced . Which sounds like a contradiction, because the Monospaced option affects only the selected text, not the whole paragraph.

In my opinion, it makes no sense that such option is buried there. Nor does it make sense that there isn't at least a keyboard shortcut for this. I would prefer that backticks worked well, but at least with a shortcut I wouldn't need to waste so much time to just format variable names when I communicate with my partners at work.

Oh wow. I didn't even know that there's this menu option. Thanks! At least I can use this now.

anbah34 commented 5 months ago

Hey folks, Request you all to refer to the Microsoft documentation that has called out a workaround for starting an inlein code block for european keyboards.

https://support.microsoft.com/en-us/office/use-markdown-formatting-in-microsoft-teams-4d10bd65-55e2-4b2d-a1f3-2bebdcd2c772

You can use the following alternatives -

  1. Shift +` + Space
  2. Shift + Alt + `
  3. Use the keyboard manager Ukelele

While this may seem an easy fix, it is a complicated issue with the underlying Rich text editor framework that powers the compose experience. Please use the above suggestions. Please know that the Microsoft Teams knows about this feedback, we have investigated this thoroughly, however there is no simple fix at the moment.

Thank you

mateusfccp commented 5 months ago

Hello, @anbah34.

What intrigues me the most is that it used to work not so long ago. It is a regression. How there's no easy fix if it used to work? Why did it stop working in the first place? Did you guys rewrite the text engine completely from scratch and forgot to add this? If so, how did you guys develop a new engine in a way that it's so hard to fix? This usually happens with legacy code, not with shiny new code. If you didn't rewrite the text engine from scratch, wouldn't the fix be to simply look back at the code from some months ago (now almost a year) and identify when the problem was introduced (with a bisect or something like this)?

anbah34 commented 5 months ago

Hey @mateusfccp, The compose uses Rich text editor (RTE) framework to power compose experiences. The RTE is based on an external vendor package (CKEditor 5). The CKEditor 5 has significantly changed in how it handles data and events from its previous version CKEditor 4. The prior version did not have this issue. So that's the reason for the regression. You will also see this issue outside of Teams in editors that use CKEditor 5. I understand the frustration and the time it has taken.

Unfortunately there is no quick fix. I want to let you all know that the Microsoft team knows about it, did an investigation, and came to this conclusion. This does not mean that we will not fix it, but we cannot give a timeline at this point.

sattes-faction commented 5 months ago

Hi @anbah34,

thanks for the update, it's good to know that the team is at least investigating and looking for a fix. I know the suffering with 3rd party tools. Unfortunately the first 2 options of your keyboard alternatives don't work - at least not on a German keyboard on Mac. Option 1 is what you would have to press on a German keyboard anyway as the keyboard layout is different. With Option 2 on Mac pressing "Option" instead of Alt simply prints a totally different character (˚).

However the worst thing is, now with the latest teams update, the toolbar option to make it work is now even farther away hidden behind the three dots and "paragraph". So instead of at least providing a convenient workaround and having it as a single toolbar button to click on, it now is even harder to format correctly. So if you already know there is no quick fix, please consider making it at least accessible via toolbar easily instead of making it even harder to reach.

ruben-grossmann commented 5 months ago

Hey folks, Request you all to refer to the Microsoft documentation that has called out a workaround for starting an inlein code block for european keyboards.

https://support.microsoft.com/en-us/office/use-markdown-formatting-in-microsoft-teams-4d10bd65-55e2-4b2d-a1f3-2bebdcd2c772

You can use the following alternatives -

1. Shift +` + Space

2. Shift + Alt + `

3. Use the keyboard manager Ukelele

While this may seem an easy fix, it is a complicated issue with the underlying Rich text editor framework that powers the compose experience. Please use the above suggestions. Please know that the Microsoft Teams knows about this feedback, we have investigated this thoroughly, however there is no simple fix at the moment.

Thank you

I don't know if I changed something or if I just didn't realize it but Option 1 works for me on a Swiss German keyboard. Thanks a lot.

EDIT: I work on Linux in Edge Browser.

victor-marino commented 5 months ago

Hey folks, Request you all to refer to the Microsoft documentation that has called out a workaround for starting an inlein code block for european keyboards.

https://support.microsoft.com/en-us/office/use-markdown-formatting-in-microsoft-teams-4d10bd65-55e2-4b2d-a1f3-2bebdcd2c772

You can use the following alternatives -

1. Shift +` + Space

2. Shift + Alt + `

3. Use the keyboard manager Ukelele

While this may seem an easy fix, it is a complicated issue with the underlying Rich text editor framework that powers the compose experience. Please use the above suggestions. Please know that the Microsoft Teams knows about this feedback, we have investigated this thoroughly, however there is no simple fix at the moment.

Thank you

None of these two shortcuts work for me on MacOS with a Spanish keyboard (regional settings and layout for Spain, Europe).

1. Shift + ` + Space // Inputs a ^ character, then obviously a space
2. Shift + Alt + ` // also inputs a ^ character

I'm on MacOS so I'm swapping Alt with the option key for #2. If I instead try to do this:

Shift + Cmd + `

It just inputs the backtick character the same way it would if I just used the ` key normally, meaning what follows is not parsed as a code snippet by Teams.

The fastest and easiest workaround that works for me is the one I discovered using MacOS' built-in text substitution tool (Settings -> Keyboard -> Text substitutions), as I explained here.

felixgenicio commented 5 months ago

Thanks for the update @anbah34

Only two things about the support page you mentioned:

To add an inline block of code, start and end the text with a backtick (` ) key, which is located next to the 1 on your keyboard, followed by a space.

There a lot of keyboard layouts in the world apart from the US one 😉

However, some users may have difficulty accessing the backtick key on their keyboard. In that case, you can use one of the following alternate keys to start an inline code block.

There's no difficulty, is just a bug from a library you're using in your product. Acknowledging it is not a shame. It could be great just to add a link to the ckeditor issue 🙏 (I haven't been able to find it).

maehne commented 5 months ago

On Linux in Chrome browser, none of the three documented workarounds are working with a German or Swiss German keyboard layout. Only switching to the US keyboard layout helps. That inline code blocks is hidden in the "Paragraph" sub-menu and the latter is not even marked as such, is non-intuitive and not at all convenient:

grafik

jjeising commented 5 months ago

You will also see this issue outside of Teams in editors that use CKEditor 5.

@anbah34 When tested in the CKEditor Examples this works fine on a German keyboard layout:

Screenshot 2024-06-27 at 01 11 11

Pressing space:

Screenshot 2024-06-27 at 01 11 14

I also can't find any related issues in ckeditor/ckeditor5 ? Do you have an upstream issue?

Looks like at least Cmd + < is working again in the latest version, to switch between windows (it previously opened settings, despite showing Cmd + , as the shortcut).

Chealer commented 5 months ago

Hey @mateusfccp, The compose uses Rich text editor (RTE) framework to power compose experiences. The RTE is based on an external vendor package (CKEditor 5). The CKEditor 5 has significantly changed in how it handles data and events from its previous version CKEditor 4. The prior version did not have this issue. So that's the reason for the regression. You will also see this issue outside of Teams in editors that use CKEditor 5. I understand the frustration and the time it has taken.

Unfortunately there is no quick fix. I want to let you all know that the Microsoft team knows about it, did an investigation, and came to this conclusion. This does not mean that we will not fix it, but we cannot give a timeline at this point.

Can you at least provide a timeline of when Microsoft will specify which CKEditor issue would be behind this regression? Ideally one which doesn't span a year during which people will keep writing hundreds of comments trying to help you diagnose and reinvent workarounds for a known issue (since your own workarounds are visibly broken)?

@Nivedipa-MSFT: If you can't define what you mean by a "feature request", please do not tag this report as one.

xjli1972 commented 5 months ago

FYI - Use Markdown formatting in Microsoft Teams - Microsoft Support

Use Markdown to share code You can format and share your code on Teams.

To add an inline block of code, start and end the text with a backtick (` ) key, which is located next to the 1 on your keyboard, followed by a space. However, some users may have difficulty accessing the backtick key on their keyboard. In that case, you can use one of the following alternate keys to start an inline code block:

After you press one of these keys, you can type your code and then press the same key again to end the code block.

To add a multi-line block of code, preface your text with ``` and then paste it into your compose box.

You'll get a live preview of your code, and you can undo any formatting by hitting Ctrl+Z.

sattes-faction commented 5 months ago

Did you actually follow the discussion here?

canutoalex commented 5 months ago

This is misleading and simply untrue, please remove: Screenshot 2024-06-28 at 09 29 25

straurob commented 5 months ago

It seems to get worse. With Version 24152.405.2925.6762 I cannot even type triple backticks ``` which would at least create a large code block.

TobiasVonEssenQED commented 5 months ago

It seems to get worse. With Version 24152.405.2925.6762 I cannot even type triple backticks ``` which would at least create a large code block.

Yep, I can back that. Same here.

matthdsm commented 5 months ago

Same issue here No inline code, nor code blocks

Teams Version 24152.405.2925.6762 (24152.405.2925.6762) MacOS 14.5 (23F79) Belgian Azerty keyboard layout

Chealer commented 5 months ago

Hey folks, Request you all to refer to the Microsoft documentation that has called out a workaround for starting an inlein code block for european keyboards.

https://support.microsoft.com/en-us/office/use-markdown-formatting-in-microsoft-teams-4d10bd65-55e2-4b2d-a1f3-2bebdcd2c772

You can use the following alternatives -

1. Shift +` + Space

2. Shift + Alt + `

3. Use the keyboard manager Ukelele

[...]

Thank you

@anbah34 : Thank you for either fixing or at least fixing your documentation:

To add an inline block of code, start and end the text with a backtick (` ) key, which is located next to the 1 on your keyboard, followed by a space.

  1. I would say my keyboard has no such thing as "a backtick key", but it certainly doesn't have one next to "the 1". The key which can type backticks is at the other end of the keyboard.
  2. One cannot "start text" or "end text" with a key. One can start/end by pressing a key.

However, some users may have difficulty accessing the backtick key on their keyboard. In that case, you can use one of the following alternate keys to start an inline code block:

The alternatives are not keys, but key combinations (or not keys at all).

@Nivedipa-MSFT : please remove the feature-request tag from this ticket.

ybizeul commented 4 months ago

Couldn't find a solution either. Anyone had it working on a mac with french keyboard, if that even matters ?

image

I just found out that changing to US keyboard layout, it works file.

FYI, on a french keyboard, backtick is on the '<' key.

nathansalaun-sofia commented 4 months ago

Anyone had it working on a mac with french keyboard, if that even matters ?

I have a french keyboard too and so far none of the proposed workarounds work.

Honestly this issue as a whole is embarrassing to watch for a company as large as Microsoft.

ObliviousMonkey commented 4 months ago

@ybizeul @nathansalaun-sofia

Install Ukulele (available with brew), and you can follow along this video by @Olivier-OH to understand the basics. Up to you to follow the exact directions or not. I chose to make the current dead key not dead anymore, so when I tap once on the £ ` key, it outputs the backtick straight away.

I've found that it prevents me from using the + Shift + . (to show hidden files), and I need to switch back to the original keyboard, which is easily done with Ctrl + + Space

nathansalaun-sofia commented 4 months ago

@ObliviousMonkey thanks for the tip, I might do just that regardless of Teams since I never use the "dead" feature of backticks anyway (in a french keyboard we have dedicated keys for all accentuated chars).

I was reluctant because I don't think it's normal to have to install a third party software that changes the keyboard layout for the whole system, just to accommodate for markdown formatting in Microsoft Teams. This is the only software on my Mac with this issue, I can't accept any excuse from Microsoft for not fixing this. I would be ashamed in their place.