Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cannot use a `|` character in table header

Đang mở
#229 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Tái hiện vấn đề trong trình chỉnh sửa bằng cách tạo bảng được cung cấp và chuyển đổi giữa các chế độ xem Markdown và xem trước. So sánh mã nguồn Markdown sau mỗi lần chuyển đổi; được xem là hoàn tất khi các ký tự pipe được escape hoặc thực thể HTML được cung cấp vẫn nguyên vẹn và bảng tiếp tục được hiển thị chính xác.

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

Mô tả

bug commonmark

Describe the bug
The stacks-editor overwrites/parses markdown when switching between preview and markdown views which is not allowing me to put a | character into a header. Some variations that I've tried:

  • Add \ to escape the pipes. the editor strips out my escapes.
  • Use the HTML character code |. This also gets parsed out and translated to just | which loses the escape
  • Combine the above 2 approaches - I\|Like\|\|Pipes Maybe we can escape the character code and escape the escapes! Toggling between markdown and preview modes progressively modifies the markdown source until the table is broken as in, it renders a proper table but shows I|Like||Pipes and then I|Like|Pipes and then broken table.
  • Try editing in the preview mode instead of the markdown. So build the table and then add the pipes in from the preview mode. Also doesn't work.

To Reproduce

  1. Try to create a table where one of the headers has a | in it. Example:
| Column1 | I\|Like\|Pipes |
| ------- | -------------- |
| tables  | r fun          |
  1. Switch to preview mode to ensure the escapes worked as I'd expect and see I|Like|Pipes in the preview.
  2. Either post or switch back to markdown view and see that the table no longer renders correctly.

Expected behavior
I should be able to put a | character into a table header if I'd like either by escaping them or using |. I'd expect toggling between view modes not to produce different results.

Screenshots
editor-table-pipe-bug

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] chrome
  • Version [e.g. 22] 107.0.5304.63

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

Ngôn ngữ chính
TypeScript
Star
439
Fork
61
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
16

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

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 StackExchange/Stacks-Editor

Tất cả issue của StackExchange/Stacks-Editor

Issue tương tự

Thêm issue về TypeScript

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.