Nested inline code, emoji and mentions disappear inside bold, italic and strikethrough

未关闭 适合新手
#1,429 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
frontend

调研方向

从 markups 包中的 BoldSpan.js、ItalicSpan.js 和 StrikeSpan.js 开始;阅读每个文件如何映射 AST 子类型,以及在哪里对未处理的子节点返回 null。用 *run yarn build first* 的解析器输出复现,然后补充缺失的 INLINE_CODE、EMOJI 和 MENTION 情况,以及 StrikeSpan.js 中的时间戳,并配上回归测试。完成意味着嵌套内容能渲染,且现有 markup 测试通过;italic/strikethrough 内部的链接和 nested-emphasis 崩溃不在范围内。

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

描述

bug

Description

Nested inline code, emoji and mentions are silently dropped by the markup renderer inside bold, italic and strikethrough.

For example, this message:

*run `yarn build` first*

renders as "run first", with the inline code missing.

Steps to reproduce

  1. Use EmbeddedChat develop at commit 1cb7bb38.
  2. Parse the example above using @rocket.chat/message-parser 0.31.29.
  3. Render the resulting AST through the markups package.
  4. Observe that the parser includes an INLINE_CODE child inside BOLD, but the rendered output drops it.

I also reproduced missing inline code, emoji and mentions inside italic and strikethrough using a local rendering harness.

Expected behaviour

Supported nested inline content should remain visible inside the formatting wrapper.

Environment

  • EmbeddedChat: develop at 1cb7bb38
  • Node.js: 24.0.0
  • Yarn: 3.6.4
  • @rocket.chat/message-parser: 0.31.29

Additional context

BoldSpan.js, ItalicSpan.js and StrikeSpan.js return null for child types they do not explicitly handle.

I have a local fix with regression tests for inline code, emoji and mentions inside these wrappers, plus timestamps inside strikethrough. Links inside italic/strikethrough and the pre-existing CommonJS nested-emphasis crashes remain outside this fix.

Related PRs #1044 and #1139 overlap with some files but address different behaviour.

Verification so far uses local package rendering, not a live Rocket.Chat server or the real chat UI.

Is this a fix you'd welcome a PR for?

主要语言
JavaScript
星标
170
派生
397
平均合并
12 天 14 小时
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

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

RocketChat/EmbeddedChat 的其他 Issue

查看 RocketChat/EmbeddedChat 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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