bug: markdown images  are not rendered in messages
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, react
- 领域
- frontend
调研方向
从 packages/markups 中的 InlineElements 开始,检查其他已解析节点类型的渲染方式。对比 packages/gazzodown 中 Rocket.Chat 的 ImageElement,以了解 issue 所述的 URL 清理行为。添加对 parser 的 IMAGE 节点的渲染;当带链接的消息和仅包含图像的消息都能显示图像及其替代文本,并符合预期行为时,即完成。
由索引模型根据 Issue 内容生成。
描述
Description:
A markdown image in a message, , is not shown at all in EmbeddedChat. The text around it is shown, but the image and its alt text disappear, and a message that is only an image renders empty. Rocket.Chat shows the image.
The message parser (@rocket.chat/message-parser) returns an IMAGE node for this syntax:
{"type":"IMAGE","value":{"src":{"type":"PLAIN_TEXT","value":"https://example.com/a.png"},"label":{"type":"PLAIN_TEXT","value":"diagram"}}}
InlineElements in packages/markups has no case for IMAGE, so it returns null. Rocket.Chat's renderer (packages/gazzodown, ImageElement) renders it as an image inside a link, after sanitizing the URL.
Steps to reproduce:
- Send
look  here. - Send
.
Expected behavior:
Both messages show the image, as in Rocket.Chat.
Actual behavior:
The first message shows only "look here", and the second message is empty.
I'd like to send a fix that adds an ImageElement to the markups package, with the same URL sanitizing as Rocket.Chat's.
- 主要语言
- JavaScript
- 星标
- 170
- 派生
- 397
- 平均合并
- 8 天 20 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RocketChat/EmbeddedChat 的其他 Issue
-
Bug: Unused media visibility check and missing useMemo dependencies cause stale/invalid actions in MessageToolbox.js可能已有人在做 @yashsarvaiya45 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
RocketChat/EmbeddedChat#1437 ·
维护者通常 1 天内回复
-
bug(layout-editor): theme refinements like "change it to dark" are ignored with AI providers可能已有人在做 @arshil42 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
RocketChat/EmbeddedChat#1433 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
RocketChat/EmbeddedChat#1431 ·
维护者通常 1 天内回复
-
bug: editing a multi-line message saves literal \n instead of line breaks可能已有人在做 @arshil42 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 92/100
RocketChat/EmbeddedChat#1430 · 3 条评论 ·
维护者通常 1 天内回复
-
Nested inline code, emoji and mentions disappear inside bold, italic and strikethrough可能已有人在做 @gitseraj 于 2 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
RocketChat/EmbeddedChat#1429 · 2 条评论 ·
维护者通常 1 天内回复
查看 RocketChat/EmbeddedChat 的全部 Issue
相似的 Issue
-
accepted enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
channels:edit check:passed
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复