lightbox: auto removes the link around a linked image

オープン 初心者向け
#15,393 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
frontend

調査の方向性

まず src/resources/filters/layout/lightbox.lua を確認します。特に、レポートでリンク付き画像を異なる方法で処理するとされているトップレベルの Link ハンドラーと processFigure に注目します。提供された Quarto ドキュメントで、lightbox: auto を使って3つのケースを再現し、lightbox: false の場合と比較します。lightbox: auto でレンダリングした HTML に3つのリンクすべてが残ることを完了条件とします。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
JavaScript
スター
6.2k
フォーク
492
平均マージ
15時間 15分
マージ済み PR(30日)
94

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/quarto-cli のほかの issue

quarto-dev/quarto-cli の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。