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

Đang mở Phù hợp với người mới
#1,429 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu trong gói markups tại BoldSpan.js, ItalicSpan.js và StrikeSpan.js; đọc cách mỗi loại ánh xạ các kiểu con của AST và nơi nó trả về null cho những con chưa được xử lý. Tái hiện với đầu ra của parser cho *run yarn build first*, sau đó thêm các trường hợp INLINE_CODE, EMOJI và MENTION còn thiếu, cùng với timestamp trong StrikeSpan.js, kèm kiểm thử hồi quy. Hoàn thành nghĩa là nội dung lồng nhau được render và các kiểm thử markup hiện có đều qua; liên kết bên trong italic/strikethrough và các sự cố nested-emphasis nằm ngoài phạm vi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
JavaScript
Star
170
Fork
397
Merge trung bình
12 ngày 14 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RocketChat/EmbeddedChat

Tất cả issue của RocketChat/EmbeddedChat

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.