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

sattes-faction commented 4 months ago

On MacOs you can also do the following workaround without any additional software:

  1. go the the keyboard text replacement settings in your system settings (or search for "text replacements" I guess, in German it's "Textersetzungen")
  2. add a new replacement, for example I told it to replace ´ with a `.
  3. after that, if you type ´ in Teams followed by a space, it will propose you the replacement which you can just confirm by using the space key. As ` is a dead key (at least in Germany), you need to press another space to confirm. So in the end, you need to use 3 spaces.

Example for inline typing: ´, Space, Space, Space write your text ´, Space, Space, Space

edit: that doesn't seem to work in all cases - and also for me only when I type slowly, so MacOS actually displays the replacement in a tooltip

TobiasVonEssenQED commented 4 months ago

On MacOs you can also do the following workaround without any additional software:

  1. go the the keyboard text replacement settings in your system settings (or search for "text replacements" I guess, in German it's "Textersetzungen")
  2. add a new replacement, for example I told it to replace ´ with a `.
  3. after that, if you type ´ in Teams followed by a space, it will propose you the replacement which you can just confirm by using the space key. As ` is a dead key (at least in Germany), you need to press another space to confirm. So in the end, you need to use 3 spaces.

Example for inline typing: ´, Space, Space, Space write your text ´, Space, Space, Space

Just tried that on Sonoma 14.5 and it does not work. My guess: text replacement of single characters doesn't work in general (haven't tried thoroughly, tho)

sattes-faction commented 4 months ago

Hmm, that's sad - I set it up exactly like this and it's working fine for me. When you're typing ´ and a space, does it propose the replacement in a little tooltip?

image

TobiasVonEssenQED commented 4 months ago

No, it doesn't. It works for all my other replacements, though, exactly like depicted. I'm on a German keyboard, if that matters.

But good thing it could be a workaround for others, then. 👍

sattes-faction commented 4 months ago

Weird, I'm on a German keyboard as well - maybe then some other character or word will work for you instead of ´ .

oyo commented 4 months ago

Since a few days also triple backticks

```[space]

won't open a code block on German keyboard layout on a Mac any more - Version 24165.1406.2974.9471 The inline code feature with single backticks suddenly disappeared about a year ago (when this ticket was created).

My workaround is now to quickly switch layouts using the [fn] key. But seriously what is going on there - non US keyboard users are losing features over time...?

Chealer commented 4 months ago

@oyo: Please see the above comments. Microsoft blames the change on a Teams dependency, but has not yet provided a timeline for disclosing which upstream issue would be the cause, despite being asked 3 weeks ago.

pladaria commented 4 months ago

This is ridiculous

thlucena-uol commented 4 months ago

This is unbelievable. Formatting text using Monospace style is one of the most used features regarding text formatting for software developers that communicate using Teams, and it is simply not available using a practical way.

Makes me wonder if Microsoft (which happens to be a company funded because of software development and that sells several solutions for companies that develop software) developers actually use their own platform for communication.

Chealer commented 4 months ago

@thlucena-uol : Of course they do, but the vast majority of them do so under Microsoft Windows.

@vancromy : At this point, it may be worth updating the description to make it (more) clear that this does not affect (any longer, I believe) MS Windows, but rather macOS and possibly GNU/Linux.

mikkorantalainen commented 4 months ago

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.

I just checked online demo of CKEditor 5 at https://ckeditor.com/docs/ckeditor5/latest/examples/builds-custom/full-featured-editor.html and backticks start and end monospaced text just fine. Whatever Microsoft did to customize the editor caused the bug. I guess you guys are using Git so just run bisect to locate the problematic change you did.

I'm using Finnish keyboard layout on Linux and here I write backtick with either of following key combinations:

  1. Shift+ ` (the key next to backspace on the number row), followed by space, or
  2. Shift+ ` twice (you can release the shift or keep it pressed down for the whole sequence).

Both of these work nicely with CKEditor 5 but neither works with Teams. And both used to work in Teams so this is just a regression.

And I understand that the regression may have been caused by a bug in the Teams codebase that only surfaced when you switched to CKEditor 5 framework.

It is possible to workaround this by switching keyboard layouts to have backtick key without dead keys but that's a workaround, not a proper solution. Teams is the only application that I regularly use which requires this kind of hacks and labeling this regression bug as "feature request" tells me that Microsoft is not going to fix this any time soon.

If you keep claiming that this is caused by CKEditor 5 framework, link to publicly reported issue for the CKEditor 5 about the root cause so we can follow when that is fixed. If you cannot do that, it's just a clear signal that you're trying to shift blame for a bug that you still cannot even fully understand.

(Update: worked around regression in escaping of backticks in GitHub: https://github.com/github/markup/issues/363 – should we now assume that backticks are problematic in any Microsoft product?)

TobiasVonEssenQED commented 4 months ago

I can confirm that the web demo of CKE 5 works on my German keyboard with Sonoma.

Off topic: Oh man, I would love to see vanilla CKE 5 in Teams. Not only does it work flawlessly, it's also following reason's rule set of interface design and the implemented text formatting is far better. 👀

kolbasa commented 4 months ago

"Real software developers use Windows!"

yoln-sttr commented 4 months ago

still not working on Mac OS Sonoma 14.4 and a US Keyboard.

triple-backtick works for code block, but single tick doesn't work for in-line code formating

yoln-sttr commented 4 months ago

still not working on Mac OS Sonoma 14.4 and a US Keyboard.

triple-backtick works for code block, but single tick doesn't work for in-line code formating

Solved it by deactivating the mac keyboard autofill under settings/keyboard/text input -> edit... -> All inputs -> Use smart quotes and dashes

couloum commented 4 months ago

still not working on Mac OS Sonoma 14.4 and a US Keyboard. triple-backtick works for code block, but single tick doesn't work for in-line code formating

Solved it by deactivating the mac keyboard autofill under settings/keyboard/text input -> edit... -> All inputs -> Use smart quotes and dashes

I'm affected by the issue too (Mac OS Sonoma 14.5 - Teams 24165.1406.2974.9471 - FR layout) but this solution doesn't work on my side. Only the switch to US layout is working.

brunottonurb commented 4 months ago

Also affected and annoyed. Mac OS 14.5 - Teams Version 24165.1406.2974.9471 - DE Layout.

Edit: I mean inline mono spaced text e.g. foo. This just renders as backticks in Teams.

Triple backticks also have no effect for me.

anbah34 commented 4 months ago

Hey Folks, I want to understand if this issue is also happening for multi-line code blocks? We recently changed the invocation of a code block from <space> to just This is the new experience that you should be seeing. image

image

Was there a regression for EU Mac keyboards in the last few weeks? Can you please confirm?

Liriel commented 4 months ago

Also affected and annoyed. Gentoo Linux - Online Teams in MS Edge 127 - DE Layout.

maehne commented 4 months ago

Inline code snippets and multi-line code blocks are not working in Chrome browser on Linux with a Swiss German keyboard with dead keys for entering the accents. However, I made an interesting observation: Inline code snippets and multi-line code blocks are working in the Firefox browser.

sattes-faction commented 4 months ago

The newest surprise to the editor in Teams is now, that it's not auto-formatting pasted links for me anymore. So I need to mark a pasted link and make it a link via toolbar. I wonder if they are actually testing their stuff before releasing.

kolbasa commented 4 months ago

The newest surprise to the editor in Teams is now, that it's not auto-formatting pasted links for me anymore. So I need to mark a pasted link and make it a link via toolbar. I wonder if they are actually testing their stuff before releasing.

I have the same problem. MS Teams is just awful. Maybe I can persuade my company to switch to Slack.

canutoalex commented 4 months ago

The newest surprise to the editor in Teams is now, that it's not auto-formatting pasted links for me anymore. So I need to mark a pasted link and make it a link via toolbar. I wonder if they are actually testing their stuff before releasing.

Workaround-y way to do it is to paste and then press Space, but yeah, annoying.

couloum commented 4 months ago

Hey Folks, I want to understand if this issue is also happening for multi-line code blocks? We recently changed the invocation of a code block from <space> to just

Was there a regression for EU Mac keyboards in the last few weeks? Can you please confirm?

@anbah34 as mentioned above, the issue is happening for both inline code block and multi-line code block. This affects FR Mac keyboards from what I can experience, but multiple users reported the same issue with other keyboard mappings. The issue is probably due to the fact that ` key on EU keyboards doesn't echo the ` character immediately, but is a modifier for grave accent on other letters, like in à è ì ò ù. When we want to echo a ` we have to actually press `<space>. The new behavior is probably incompatible with EU keyboard but works on US keyboards because backtick is directly echoed when pressing the key on the keyboard.

The workaround suggested by @Sidelobe here seems to be the best option at the moment.

anbah34 commented 4 months ago

Hey Folks, Thanks for the information. I also want to point out on an alternative for code blocks that will work for EU Mac keyboards. You can hit /code in the compose box to start a new code block. The slash command only works for code block but not for inline code.

WarpRules commented 4 months ago

I need to use Linux for my work, and thus I have to use the browser versions of MS applications, such as Outlook and Teams.

I can confirm that at some point in the recent past almost all markdown stopped working in the browser version of Teams. Single backticks, triple backticks (with a space or not, doesn't matter), "> " for quotes... none work. They are just sent as-is, and no code snippets can be inlined or quotes created in this manner. (You can create a code block with the input textbox menu, but that's not exactly the same thing as what the triple backticks do. It's serviceable, but not the same. However, the lack of support for single backticks in order to insert a snippet of code inline is highly annoying.)

The only markdown that still seems to work is using underscores for italics. We'll see when that stops working as well.

black-snow commented 4 months ago

This is still annoying the crap out of me. How is this still open after more than a year? :/

nathansalaun-sofia commented 4 months ago

Oh yeah that's right it's been a year, happy Markdown is broken in Teams anniversary everyone 🥳

turbotimon commented 3 months ago

I've been annoyed by this for a long time. It seems that Microsoft is not able (or willing) to fix this despite NO other tool I know has this problem as well, so it can't be that hard.. 😵‍💫

kolbasa commented 3 months ago

It's Microsoft, they simply don't care.

Eduard-Huebner commented 3 months ago

Checking in to say that switching to US keyboard layout doesn't work for me either. Is this on purpose to annoy mac users? Feels bad to read this thread and see how old it is.

mikkorantalainen commented 3 months ago

Checking in to say that switching to US keyboard layout doesn't work for me either.

The problem is not keyboard layout itself but compose keys / "dead keys". If you use any method to write ` that requires pressing space or pressing the keyboard button twice, then Teams cannot support it. I guess they are listening to incorrect JavaScript events and for some reason they cannot fix it.

For example, I use Finnish layout with dead keys on Linux and I write ` with key combination Shift+` followed by a single space and this is not supported by Teams because they inspect the last entered character when I press the space. I guess they simply apply logic that the last key pressed was space so there's no need to check the actual character in the text input.

(Compare: if I write Shift+` followed by a o I get ò. MacOS calls the same thing "compose key" instead of "dead key" but the behavior is very similar. The "dead key" comes from the fact that historically nothing would show up on the screen after the Shift+` and that was called dead key because apparently nothing happened but behind the scenes it was waiting for next button press to figure out which character to finally emit. Nowadays Linux shows underlined ` after pressing Shift+` to signal that combining character has been entered. MacOS uses different indicator: there you see dashed circle below the ` to signal the combining character input. Other than visual indicator during the sequence, both work the same.)

oyo commented 3 months ago

I guess they are listening to incorrect JavaScript events and for some reason they cannot fix it.

The strange thing is that both features were working in the past with my german keyboard but stopped working from one day to the other - single backtick inline code about a year ago and the triple backtick code block only a few weeks ago.

ybizeul commented 3 months ago

I thought I found the "fix" here but I don't see it in the thread.

You can use Ukelele to create a new keyboard based on your language and change the dead key "`" to a regular key that types the "`" character directly.

Once you've done that and switch to that keyboard, everything works fine.

straurob commented 3 months ago

You can use Ukelele to create a new keyboard based on your language [...] Once you've done that and switch to that keyboard, everything works fine.

To be honest, I disagree with this. I don't see why I should install additional third-party software to create a workaround. Microsoft introduced this regression, so it's their task to fix it.

illnr commented 3 months ago

The only solution that currently works for me on Mac is to use the shortcut listed here for "Insert code.": "Command+Alt+5". 🙏

frito commented 3 months ago

Since @mikkorantalainen did the analysis for you, please just provide a fix for this annoying bug, something that was working before and I was using in my everyday work. By the way, even ~ is a dead key on MacOS, so strikethroug doesn't work either.

md2perpe commented 3 months ago

The problem is not keyboard layout itself but compose keys / "dead keys". If you use any method to write ` that requires pressing space or pressing the keyboard button twice, then Teams cannot support it. I guess they are listening to incorrect JavaScript events and for some reason they cannot fix it.

I'm using a MacBook Pro and Swedish keyboard layout where I press [shift]+[´] to get a backtick.

Writing three backticks and then space used to work for me, but now it doesn't. Perhaps it stopped working when I changed from "old Teams" to "new Teams".

By the way, even ~ is a dead key on MacOS, so strikethroug doesn't work either.

Confirmed on my computer.

DennisJohnsen commented 3 months ago

image image

Macbook Pro M3 (14.6.1) Teams (24193.1707.3028.4282.)

Dosn't seem like any markdown works. Code and strikethrough example in the images.

Chealer commented 3 months ago

I do not think more user feedback will help Microsoft much to fix this, but if you are going to report more affected systems here, please minimally specify their OS and keyboard layout.

danieljameswilliams commented 2 months ago

I am having the same issue too, but only on macOS, works on my windows machine. I am using a danish keyboard layout. Version 24193.1707.3028.4282 (24193.1707.3028.4282)

lucasmat7 commented 2 months ago

+1 here macOS Sonoma 14.5 Microsoft Teams Desktop app version 24231.507.3099.9636 German - Standard keyboard layout.

I can confirm that this is most likely caused by the dead key behaviour, trying the workaround posted here (making a custom keyboard layout with ukulele where (`) is not a dead key) works and I can now make inline code on teams.

This is silly, on slack everything works out of the box even with the dead key behaviour

mlafon commented 2 months ago

On Linux, you can use xmodmap to show how grave can be triggered without the deadkey modifier (search for grave and not dead_grave).

$ xmodmap -pke | grep "\<grave\>"
keycode  33 = p P p P paragraph grave
keycode  49 = oe OE grave asciitilde leftdoublequotemark rightdoublequotemark

On my French keymap, [AltGr]+[Shift]+[P] trigger a backtick that can be used in MS Teams for inline code.

ugr3y commented 2 months ago

Mac OS: Sequoia 15.0 (but had not been working on 14 either) Teams client version: 50/24080212011 Keyboard layout: Finnish

This issue had been boggling me for quite some time now, but @mlafon 's comment finally solved it for me! for me it was [AltGr]+[Shift]+[´]

nathansalaun-sofia commented 2 months ago

FYI [AltGr]+[Shift]+[´] does a # on French keyboards. I have yet to find a workaround for French keyboards that doesn't involve 3rd party software.

G-Fuchter commented 2 months ago

I had the same issue on 5.15.165-1-MANJARO using ms-teams version 1415/24081700421 . I had my keyboard set to English (US, alt. intl.) and for me switching to English (US, euro on 5) fixed the issue.

jernejr commented 2 months ago

Can confirm on Fedora (6.10.11-200.fc40.x86_64) on Teams Web client version 1415/24081700421 in Chrome with

System Locale: LANG=en_US.UTF-8
               LC_NUMERIC=sl_SI.UTF-8
               LC_TIME=sl_SI.UTF-8
               LC_MONETARY=sl_SI.UTF-8
               LC_PAPER=sl_SI.UTF-8
               LC_MEASUREMENT=sl_SI.UTF-8
    VC Keymap: si
   X11 Layout: si

and

$> xmodmap -pke | grep "\<grave\>"
keycode  16 = 7 slash 7 ampersand dead_grave grave
keycode  49 = cedilla diaeresis grave asciitilde
keycode  55 = v V v V at grave

the shortcut AltGr+Shift+v works as a workaround to create inline or block code snippets in teams.

Liriel commented 2 months ago

It works as expected in Firefox btw...

6.6.47-gentoo sway 1.9 on Wayland 1.23, german keyboard, de-AT keymap, en_US.utf8 locale

is this actually a chromium / electron related issue?

danieljameswilliams commented 1 month ago

This does not work on a danish keyboard on a mac on the desktop app, but it works on my windows machine with the same keyboard shortcut SHIFT+[´]

I have also tried CMD+SHIFT+[´] to turn the [´] the other way.

Microsoft Teams version 24193.1707.3028.4282
Klientversionen 50/24090101421
simensol commented 1 month ago

On a Mac with the Norwegian keyboard, Option + ` works:

teams

However, Shift + ` doesn’t work, even though it produces a backtick.