mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Improve hints for show rule recursion depth (#5856)
This commit is contained in:
parent
d11ad80dee
commit
2eef9e84e1
@ -312,7 +312,8 @@ impl Route<'_> {
|
||||
if !self.within(Route::MAX_SHOW_RULE_DEPTH) {
|
||||
bail!(
|
||||
"maximum show rule depth exceeded";
|
||||
hint: "check whether the show rule matches its own output"
|
||||
hint: "maybe a show rule matches its own output";
|
||||
hint: "maybe there are too deeply nested elements"
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
|
@ -44,18 +44,21 @@
|
||||
--- recursion-via-include-in-layout ---
|
||||
// Test cyclic imports during layout.
|
||||
// Error: 2-38 maximum show rule depth exceeded
|
||||
// Hint: 2-38 check whether the show rule matches its own output
|
||||
// Hint: 2-38 maybe a show rule matches its own output
|
||||
// Hint: 2-38 maybe there are too deeply nested elements
|
||||
#layout(_ => include "recursion.typ")
|
||||
|
||||
--- recursion-show-math ---
|
||||
// Test recursive show rules.
|
||||
// Error: 22-25 maximum show rule depth exceeded
|
||||
// Hint: 22-25 check whether the show rule matches its own output
|
||||
// Hint: 22-25 maybe a show rule matches its own output
|
||||
// Hint: 22-25 maybe there are too deeply nested elements
|
||||
#show math.equation: $x$
|
||||
$ x $
|
||||
|
||||
--- recursion-show-math-realize ---
|
||||
// Error: 22-33 maximum show rule depth exceeded
|
||||
// Hint: 22-33 check whether the show rule matches its own output
|
||||
// Hint: 22-33 maybe a show rule matches its own output
|
||||
// Hint: 22-33 maybe there are too deeply nested elements
|
||||
#show heading: it => heading[it]
|
||||
$ #heading[hi] $
|
||||
|
Loading…
x
Reference in New Issue
Block a user