lightbox: auto removes the link around a linked image

Đang mở Phù hợp với người mới
#15,393 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
76/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 với src/resources/filters/layout/lightbox.lua, đặc biệt là bộ xử lý Link ở cấp cao nhất và processFigure, những thành phần mà báo cáo cho biết xử lý hình ảnh có liên kết theo cách khác nhau. Tái hiện ba trường hợp trong tài liệu Quarto được cung cấp với lightbox: auto và so sánh với lightbox: false. Hoàn tất khi cả ba liên kết vẫn còn trong HTML được tạo với lightbox: auto.

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

Mô tả

bug lightbox
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

With lightbox: auto, an image wrapped in a link loses its link in the HTML output.
It gets no lightbox either.
Linked images inside a layout-ncol div behave the same.

With lightbox: false, or with .nolightbox on the image, the links are kept.

The top-level Link handler in src/resources/filters/layout/lightbox.lua skips images that are already inside a link.
processFigure walks the Image of a figure without that check, and a paragraph that holds only a linked image is a figure.

Steps to reproduce
---
title: "Reproducible Quarto Document"
format: html
lightbox: auto
---

[![A linked image]({{< placeholder 300 200 >}})](https://quarto.org)

::: {layout-ncol=2}
[![Left]({{< placeholder 300 200 >}})](https://quarto.org/docs/guide/)

[![Right]({{< placeholder 300 200 >}})](https://quarto.org/docs/reference/)
:::
Actual behavior

The rendered HTML has no link to quarto.org and no a.lightbox element.

Expected behavior

lightbox: auto leaves a linked image alone, so the three links stay, as with lightbox: false.

Your environment
  • OS: macOS 27.2.
  • Quarto: development build at commit 1d80652ba.
Quarto check output
Quarto 99.9.9
[✓] Checking environment information...
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.13.0: OK
      Dart Sass version 1.107.1: OK
      Deno version 2.9.8: OK
      Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 1d80652ba64516c46173120048892c6694be9fb6
Ngôn ngữ chính
JavaScript
Star
6.2k
Fork
492
Merge trung bình
15 giờ 15 phút
Pull request đã merge (30 ngày)
94

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 quarto-dev/quarto-cli

Tất cả issue của quarto-dev/quarto-cli

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.