mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix multiple footnotes in footnote entry (#5545)
This commit is contained in:
parent
e6de044b1d
commit
62567fc91e
@ -470,7 +470,20 @@ impl<'a, 'b> Composer<'a, 'b, '_, '_> {
|
|||||||
|
|
||||||
// Lay out nested footnotes.
|
// Lay out nested footnotes.
|
||||||
for (_, note) in nested {
|
for (_, note) in nested {
|
||||||
self.footnote(note, regions, flow_need, migratable)?;
|
match self.footnote(note, regions, flow_need, migratable) {
|
||||||
|
// This footnote was already processed or queued.
|
||||||
|
Ok(_) => {}
|
||||||
|
// Footnotes always request a relayout when processed for the
|
||||||
|
// first time, so we ignore a relayout request since we're
|
||||||
|
// about to do so afterwards. Without this check, the first
|
||||||
|
// inner footnote interrupts processing of the following ones.
|
||||||
|
Err(Stop::Relayout(_)) => {}
|
||||||
|
// Either of
|
||||||
|
// - A `Stop::Finish` indicating that the frame's origin element
|
||||||
|
// should migrate to uphold the footnote invariant.
|
||||||
|
// - A fatal error.
|
||||||
|
err => return err,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since we laid out a footnote, we need a relayout.
|
// Since we laid out a footnote, we need a relayout.
|
||||||
|
BIN
tests/ref/issue-5256-multiple-footnotes-in-footnote.png
Normal file
BIN
tests/ref/issue-5256-multiple-footnotes-in-footnote.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 796 B |
@ -291,3 +291,7 @@ A #footnote(numbering: "*")[B]<fn>, C @fn, D @fn, E @fn.
|
|||||||
// Test whether an empty footnote would cause infinite loop
|
// Test whether an empty footnote would cause infinite loop
|
||||||
#show footnote.entry: it => {}
|
#show footnote.entry: it => {}
|
||||||
#lorem(3) #footnote[A footnote]
|
#lorem(3) #footnote[A footnote]
|
||||||
|
|
||||||
|
--- issue-5256-multiple-footnotes-in-footnote ---
|
||||||
|
// Test whether all footnotes inside another footnote are listed.
|
||||||
|
#footnote[#footnote[A]#footnote[B]#footnote[C]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user