Extra leading spaces when wrapping list to fixed width
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
- 35/100
Hướng nghiên cứu
Tái hiện đầu ra bao dòng của danh sách bằng entry point dòng lệnh cmark và độ rộng được báo cáo là 80. Kiểm tra hành vi kết xuất và bao dòng của danh sách, sau đó thêm hoặc cập nhật coverage cho ví dụ; hoàn thành khi các mục danh sách được bao dòng không có thêm hai khoảng trắng ở đầu, trong khi các dòng tiếp nối vẫn được thụt lề 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ả
Here is a simple Markdown list:
❯ cat ./list.md
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in the list. That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on incredible stuff we're not used to see everyday](#link-3) - Line #3's description.
Re-wrapping this to a maximum length of 80 characters introduces 2 spaces before each lines:
❯ /System/Volumes/Data/usr/local/opt/cmark/bin/cmark --to commonmark --width 80 ./list.md
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in the list.
That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on incredible
stuff we're not used to see everyday](#link-3) - Line \#3's description.
Here I expect cmark to get rid of these leading spaces and render as such:
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in the list.
That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on incredible stuff
we're not used to see everyday](#link-3) - Line \#3's description.
Why? So we can fix a regression in pandoc. See how the previous flavor (markdown_github) behaved in that situation compared to the new one (gfm, based on cmark):
❯ pandoc --version
pandoc 2.9.2.1
Compiled with pandoc-types 1.20, texmath 0.12.0.1, skylighting 0.8.3.2
❯ pandoc ./list.md --to=markdown_github
[WARNING] Deprecated: markdown_github. Use gfm instead.
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in
the list. That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on
incredible stuff we’re not used to see everyday](#link-3) - Line
\#3’s description.
❯ pandoc ./list.md --to=gfm
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in
the list. That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on
incredible stuff we’re not used to see everyday](#link-3) - Line
\#3’s description.
I guess this behaviour should be somewhat configurable in cmark as pandoc does with the --tab-stop parameter:
❯ pandoc ./list.md --to=markdown_github --tab-stop=2
[WARNING] Deprecated: markdown_github. Use gfm instead.
- [Link 1](#link-1) - Description of line 1.
- [Link 2](#link-2) - A very long description for the second link in the
list. That description is more than 80 characters wide.
- [This is a very long title, pointing to an awesome article on
incredible stuff we’re not used to see everyday](#link-3) - Line \#3’s
description.
For reference, here the version of cmark I'm using, installed with brew on macOS Catalina:
❯ brew install cmark
(...)
==> Downloading https://homebrew.bintray.com/bottles/cmark-0.29.0_1.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/3a/3af95418f96f4b0cec4bd76abaab312f3caf4cea591f38d3b725f15068d06491?__gda__=exp=1593691219~hmac=7f6c15036b995f36438e934f5bd44ec8
######################################################################## 100.0%
==> Pouring cmark-0.29.0_1.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/cmark/0.29.0_1: 17 files, 724.9KB
❯ /System/Volumes/Data/usr/local/opt/cmark/bin/cmark --version
cmark 0.29.0 - CommonMark converter
(C) 2014-2016 John MacFarlane
- Ngôn ngữ chính
- C
- Star
- 2k
- Fork
- 698
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của commonmark/cmark
-
Incorrect `parser->offset` advancement for closing fenced code blocks in `parse_code_block_prefix`Có thể đã có người làm @cpruijsen đã nhận 24 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
commonmark/cmark#590 · 3 bình luận ·
-
API documentation is missing an explanation of CMARK_NODE_CUSTOM_BLOCK and CMARK_NODE_CUSTOM_INLINEĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
commonmark/cmark#441 · 2 bình luận ·
-
Inline code languageĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
commonmark/cmark#626 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
commonmark/cmark#624 ·
-
Single-space blank line evicts a list-item continuationCó thể đã có người làm @afonsojanu đã nhận 34 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
commonmark/cmark#618 ·
Tất cả issue của commonmark/cmark
Issue tương tự
-
rc_runtime_activate_richpresence leaves a half-initialised entry when the buffer allocation failsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
RetroAchievements/rcheevos#558 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
libsdl-org/SDL#16464 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
chore(gateway): emit INFO budget reserved/settled logs for proactivity v2 (chip task_2855f4ec)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbackend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
BasedHardware/omi#20940 ·
Maintainer thường phản hồi trong vòng 1 ngày