[BUG] Teams / Graph API Regression: "codeBlockEditor" vs <codeblock> in HTML Content Results

未关闭
#1,995 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
20/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
领域
api, backend

调研方向

Start by reproducing the issue with a Teams chat message containing inline code followed by a triple-backtick block, then query it with GET /v1.0/chats/{id}/messages/{msg}. The payload names no files, tests, or SDK entry point; done would require the returned HTML to preserve each code block's own content instead of reusing an earlier code element.

由索引模型根据 Issue 内容生成。

描述

status:waiting-for-triage type:bug
Describe the bug

Per: https://learn.microsoft.com/en-us/answers/questions/5728345/(bug)-teams-graph-api-regression-codeblockeditor-v

[I'm not sure if the "Javascript SDK" is the right place for this, because it's a server-side bug, but here goes... If there's a better repository, I'd be happy to repost it there, thanks!]

Within the past week or so (January 2026) whenever I GET /v1.0/chats/{id}/messages/{msg}, it seems that "triple-backtick" code blocks have gone from being sent as <p itemtype="http://schema.skype.com/CodeBlockEditor"> elements to dedicated <codeblock> tags, with embedded <code> inside...

That wouldn't be a problem, EXCEPT I've noticed that when there's another <code> tag earlier in the message content, it replaces the contents of any subsequent <codeblock><CODE>...</CODE></codeblock> blocks.

To wit:

    The `message` is:
    ```
        Hello, world!
    ```

Produces the following snippet of JSON:

    "body": {
      "content": "<p>The <code>message</code> is:</p>\n<codeblock class=\"PlainText\"><code>message</code></codeblock>",
      "contentType": "html"
    }

Note that the second message does NOT say "Hello, world!"

This also happens for other "triple-backtick" code blocks:

    ```
    Line One
    ```

    Line `Two`

    ```
    Line Three
    ```

Becomes "One, Two, One" :-(

Expected behavior

In the first example, I would expect to see <codeblock><code> Hello, world!</code></codeblock>

How to reproduce

Send a Teams message (chat or channel) with the markup:

    This is `inline code`

    ```
    This is a block
    ```

Then query that message via the Graph API; you'll see that it returns the wrong results.

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

No response

Configuration

No response

Other information

Like I say, I tried looking for a more API-related repository, but github.com/microsoftgraph lists, like, 230 different repos, and I only made it through ~3 pages of results before I gave up... «sigh»

主要语言
TypeScript
星标
833
派生
240
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoftgraph/msgraph-sdk-javascript 的其他 Issue

查看 microsoftgraph/msgraph-sdk-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。