diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-09-02 20:43:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-02 18:43:59 +0000 |
| commit | cfde809feb33bc057e860c5128c74fb9df6f030c (patch) | |
| tree | 5b367da382b9dab2840ce99ec05bad03f3039168 /tests | |
| parent | 9fd796e0e24ef9a76f8f7328e0a1eed350e91320 (diff) | |
New realization / Text show rules now work across elements (#4876)
Diffstat (limited to 'tests')
24 files changed, 67 insertions, 13 deletions
diff --git a/tests/ref/flow-first-region-counter-update-placed-and-line.png b/tests/ref/flow-first-region-counter-update-placed-and-line.png Binary files differindex 95ca518e..c5950783 100644 --- a/tests/ref/flow-first-region-counter-update-placed-and-line.png +++ b/tests/ref/flow-first-region-counter-update-placed-and-line.png diff --git a/tests/ref/grid-breaking-expand-vertically.png b/tests/ref/grid-breaking-expand-vertically.png Binary files differindex 14434d7c..2e1b2db2 100644 --- a/tests/ref/grid-breaking-expand-vertically.png +++ b/tests/ref/grid-breaking-expand-vertically.png diff --git a/tests/ref/label-on-text.png b/tests/ref/label-on-text.png Binary files differdeleted file mode 100644 index 67fb1aa8..00000000 --- a/tests/ref/label-on-text.png +++ /dev/null diff --git a/tests/ref/page-marginal-style-show-rule-with-set-page.png b/tests/ref/page-marginal-style-show-rule-with-set-page.png Binary files differindex 138f2272..f05c64a7 100644 --- a/tests/ref/page-marginal-style-show-rule-with-set-page.png +++ b/tests/ref/page-marginal-style-show-rule-with-set-page.png diff --git a/tests/ref/show-set-text-order-contained-1.png b/tests/ref/show-set-text-order-contained-1.png Binary files differindex 8deaaacd..1bc95e3b 100644 --- a/tests/ref/show-set-text-order-contained-1.png +++ b/tests/ref/show-set-text-order-contained-1.png diff --git a/tests/ref/show-set-text-order-contained-2.png b/tests/ref/show-set-text-order-contained-2.png Binary files differindex 00ea3fb8..89309370 100644 --- a/tests/ref/show-set-text-order-contained-2.png +++ b/tests/ref/show-set-text-order-contained-2.png diff --git a/tests/ref/show-set-text-order-overlapping-1.png b/tests/ref/show-set-text-order-overlapping-1.png Binary files differindex 71222567..83983b4d 100644 --- a/tests/ref/show-set-text-order-overlapping-1.png +++ b/tests/ref/show-set-text-order-overlapping-1.png diff --git a/tests/ref/show-set-text-order-overlapping-2.png b/tests/ref/show-set-text-order-overlapping-2.png Binary files differindex f1b658f2..83983b4d 100644 --- a/tests/ref/show-set-text-order-overlapping-2.png +++ b/tests/ref/show-set-text-order-overlapping-2.png diff --git a/tests/ref/show-text-after-normal-show.png b/tests/ref/show-text-after-normal-show.png Binary files differnew file mode 100644 index 00000000..517ad638 --- /dev/null +++ b/tests/ref/show-text-after-normal-show.png diff --git a/tests/ref/show-text-apostrophe.png b/tests/ref/show-text-apostrophe.png Binary files differnew file mode 100644 index 00000000..7c328836 --- /dev/null +++ b/tests/ref/show-text-apostrophe.png diff --git a/tests/ref/show-text-citation-smartquote.png b/tests/ref/show-text-citation-smartquote.png Binary files differnew file mode 100644 index 00000000..d3a2b5c3 --- /dev/null +++ b/tests/ref/show-text-citation-smartquote.png diff --git a/tests/ref/show-text-citation.png b/tests/ref/show-text-citation.png Binary files differnew file mode 100644 index 00000000..9a402dfe --- /dev/null +++ b/tests/ref/show-text-citation.png diff --git a/tests/ref/show-text-linebreak.png b/tests/ref/show-text-linebreak.png Binary files differnew file mode 100644 index 00000000..716eca42 --- /dev/null +++ b/tests/ref/show-text-linebreak.png diff --git a/tests/ref/show-text-list.png b/tests/ref/show-text-list.png Binary files differnew file mode 100644 index 00000000..4d04a8cf --- /dev/null +++ b/tests/ref/show-text-list.png diff --git a/tests/ref/show-text-outer-space.png b/tests/ref/show-text-outer-space.png Binary files differnew file mode 100644 index 00000000..d497af83 --- /dev/null +++ b/tests/ref/show-text-outer-space.png diff --git a/tests/ref/show-text-smartquote.png b/tests/ref/show-text-smartquote.png Binary files differnew file mode 100644 index 00000000..9a93c66c --- /dev/null +++ b/tests/ref/show-text-smartquote.png diff --git a/tests/ref/show-text-space-collapsing.png b/tests/ref/show-text-space-collapsing.png Binary files differnew file mode 100644 index 00000000..5794cefe --- /dev/null +++ b/tests/ref/show-text-space-collapsing.png diff --git a/tests/ref/show-text-style-boundary.png b/tests/ref/show-text-style-boundary.png Binary files differnew file mode 100644 index 00000000..39a440f2 --- /dev/null +++ b/tests/ref/show-text-style-boundary.png diff --git a/tests/ref/show-text-within-par.png b/tests/ref/show-text-within-par.png Binary files differnew file mode 100644 index 00000000..e7bccc49 --- /dev/null +++ b/tests/ref/show-text-within-par.png diff --git a/tests/suite/foundations/label.typ b/tests/suite/foundations/label.typ index 4875f697..af6d2380 100644 --- a/tests/suite/foundations/label.typ +++ b/tests/suite/foundations/label.typ @@ -19,15 +19,6 @@ The end. #let b = [*B*] #a <v> #b ---- label-on-text --- -// Test labelled text. -#show "t": it => { - set text(blue) if it.has("label") and it.label == <last> - it -} - -This is a thing #[that <last>] happened. - --- label-dynamic-show-set --- // Test abusing dynamic labels for styling. #show <red>: set text(red) diff --git a/tests/suite/layout/flow/invisibles.typ b/tests/suite/layout/flow/invisibles.typ index 28118cb9..e9c2436f 100644 --- a/tests/suite/layout/flow/invisibles.typ +++ b/tests/suite/layout/flow/invisibles.typ @@ -56,6 +56,6 @@ Mix-and-match all the previous tests. #counter("dummy").step() #place(dx: -0.5cm, dy: -0.75cm, box(width: 200%)[OOF]) #line(length: 100%) - #place(dy: -0.8em)[OOF] + #place(dy: 0.2em)[OOF] #rect(height: 2cm, fill: gray) ] diff --git a/tests/suite/layout/grid/grid.typ b/tests/suite/layout/grid/grid.typ index 2d45095d..d35adca5 100644 --- a/tests/suite/layout/grid/grid.typ +++ b/tests/suite/layout/grid/grid.typ @@ -184,8 +184,8 @@ Top #align(bottom)[ Bottom \ - Bottom \ - #v(0pt) + Bottom + Top ] ], diff --git a/tests/suite/layout/place.typ b/tests/suite/layout/place.typ index 0922800d..c29d2ddd 100644 --- a/tests/suite/layout/place.typ +++ b/tests/suite/layout/place.typ @@ -54,9 +54,9 @@ Second --- place-float --- #set page(height: 140pt) #set place(clearance: 5pt) -#lorem(6) #place(auto, float: true, rect[A]) #place(auto, float: true, rect[B]) +#lorem(6) #place(auto, float: true, rect[C]) #place(auto, float: true, rect[D]) diff --git a/tests/suite/styling/show-text.typ b/tests/suite/styling/show-text.typ index 56b659b2..d073f72e 100644 --- a/tests/suite/styling/show-text.typ +++ b/tests/suite/styling/show-text.typ @@ -131,3 +131,66 @@ Heya #show "Heya": set text(red) #show "yaho": set text(weight: "bold") Heyaho + +--- show-text-smartquote --- +#show "up,\" she": set text(red) +"What's up," she asked. + +--- show-text-apostrophe --- +#show regex("Who's|We've"): highlight +Who's got it? \ +We've got it. + +--- show-text-citation --- +#show "hey": [@arrgh] +@netwok hey + +#show bibliography: none +#bibliography("/assets/bib/works.bib") + +--- show-text-list --- +#show "hi": [- B] +- A +hi +- C + +--- show-text-citation-smartquote --- +#show "hey \"": [@arrgh] +#show "dis": [@distress] +@netwok hey " dis + +#show bibliography: none +#bibliography("/assets/bib/works.bib") + +--- show-text-linebreak --- +#show "lo\nwo": set text(red) +Hello #[ ] \ +#[ ] #[ ] world! + +--- show-text-after-normal-show --- +#show rect: "world" +#show "lo wo": set text(red) +hello #rect() + +--- show-text-space-collapsing --- +#show "i ther": set text(red) +hi#[ ]#[ ]the#"re" + +--- show-text-style-boundary --- +#show "What's up": set text(blue) +#show "your party": underline +What's #[ ] up at #"your" #text(red)[party?] + +--- show-text-within-par --- +#show "Pythagoras'": highlight +$a^2 + b^2 = c^2$ is Pythagoras' theorem. + +--- show-text-outer-space --- +// Spaces must be interior to strong textual elements for matching to work. +// For outer spaces, it is hard to say whether they would collapse. +#show "a\n": set text(blue) +#show "b\n ": set text(blue) +#show " c ": set text(blue) +a \ #h(0pt, weak: true) +b \ #h(0pt, weak: true) +$x$ c $y$ |
