Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index.lua: be more robust when converting index caption to string #7629

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/resources/filters/crossref/index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ end

local function index_caption(v)
if #v.caption > 0 then
if pandoc.utils.type(v.caption[1]) == "Inline" then
return inlinesToString(pandoc.Inlines({v.caption[1]}))
else
return inlinesToString(pandoc.Inlines(v.caption[1].content))
end
return inlinesToString(quarto.utils.as_inlines(v.caption))
else
return ""
end
Expand Down
1 change: 1 addition & 0 deletions tests/docs/smoke-all/2023/11/17/foo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/
19 changes: 19 additions & 0 deletions tests/docs/smoke-all/2023/11/17/foo/7236.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "Raw TeX cross referencing"
format:
pdf: default
---

See @tbl-tex:

```{=latex}
\begin{tabular}{@{}lll@{}}
\label{tbl-tex}
\caption{Some letters with LaTeX}
\toprule
Column 1 & Column 2 & Column 3 \\ \midrule
A & B & C \\
D & E & F \\
G & H & I \\ \bottomrule
\end{tabular}
```
7 changes: 7 additions & 0 deletions tests/docs/smoke-all/2023/11/17/foo/Foo.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Foo"
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
5 changes: 5 additions & 0 deletions tests/docs/smoke-all/2023/11/17/foo/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project:
title: "Foo"