qmd-syntax-helper: Pandoc-based rules lose reference links and footnotes that depend on the rest of the document
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
- 77/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- markdown, rust
- Lĩnh vực
- documentation, tooling
Hướng nghiên cứu
Issue đề xuất thêm cảnh báo trong hướng dẫn di chuyển và một cảnh báo tùy chọn cho các chuỗi dấu ngoặc vuông được escape trong đầu ra của qmd-syntax-helper; issue không nêu tệp hay bài kiểm thử nào. Trước tiên, hãy tìm hướng dẫn di chuyển và phần xử lý đầu ra của helper, sau đó kiểm tra cách các quy tắc của nó báo cáo kết quả chuyển đổi. Công việc hoàn tất khi hướng dẫn giải thích rằng cần chuyển đổi các tham chiếu và chú thích cuối trang bên trong những khối bị ảnh hưởng trước khi chuyển đổi, đồng thời đầu ra có thể đánh dấu các dấu ngoặc vuông được escape để xem xét.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Some qmd-syntax-helper rules (definition-lists, and grid-tables when it produces list tables) pass the construct they convert through Pandoc and write it back from Pandoc's AST. Pandoc only sees the construct itself, not the rest of the document. Markup inside it that depends on something elsewhere in the document therefore cannot be resolved: reference-style links and their [label]: url definitions, and footnote references with their [^n]: ... definitions. That markup is written back as escaped literal text (\[the manual\]\[docs\], \[\^1\]), and the link or footnote is silently lost.
Running the rules in the other order does not help. Before conversion, q2 reads a Pandoc definition list as literal text, so the reference-links rule cannot see uses inside it. It then treats their definitions as unused and removes them. Either way, the URL for a reference link inside a definition list disappears from the document. It can only be recovered from version control. I don't think this can be prevented in general: the construct has to be converted before its contents are visible to q2, and converting it is what strips the context. But the migration guide should warn about it. The helper could also flag its own output when it contains escaped \]\[ or \[\^ sequences, so these cases get a manual look.
Example
Some prose with a [working link][docs].
Term
: A definition that cites [the manual][docs]
and has a footnote[^1].
[docs]: https://example.com/docs
[^1]: The footnote text.
Pandoc renders both links and the footnote. After qmd-syntax-helper convert -r definition-lists -i:
Some prose with a [working link][docs].
::: {.definition-list}
* Term
* A definition that cites \[the manual\]\[docs\]
and has a footnote\[\^1\].
:::
[docs]: https://example.com/docs
[^1]: The footnote text.
and then after -r reference-links:
Some prose with a [working link](https://example.com/docs).
::: {.definition-list}
* Term
* A definition that cites \[the manual\]\[docs\]
and has a footnote\[\^1\].
:::
[^1]: The footnote text.
The link inside the definition is now literal text, and its URL is gone. The footnote reference is literal and its definition is orphaned. Running reference-links first and definition-lists second ends in the same state: the use inside the definition list is not seen, so [docs]: is removed in the first step.
A suggested sentence for the migration guide: before converting definition lists or grid tables, convert any reference-style links and footnotes inside them to inline form by hand ([text](url), ^[note]). Afterwards, review the converted blocks for escaped brackets.
qmd-syntax-helper 0.1.0, pandoc 3.13.
- Ngôn ngữ chính
- Rust
- Star
- 321
- Fork
- 23
- Merge trung bình
- 11 giờ 39 phút
- Pull request đã merge (30 ngày)
- 251
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 quarto-dev/q2
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
quarto-dev/q2#1446 ·
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 75/100
quarto-dev/q2#1095 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
quarto-dev/q2#1448 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
quarto-dev/q2#1447 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
quarto-dev/q2#1444 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/q2
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ProvableHQ/snarkOS#4817 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
facebookexperimental/reverie#193 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pbakaus/impeccable#1748 ·
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 82/100
farion1231/cc-switch#10196 ·
Maintainer thường phản hồi trong vòng 1 ngày