fix: keep real spaces between the closer quote's words
This commit is contained in:
@@ -78,12 +78,13 @@ if (posterFailed.value) recordTestFaultEvent('poster-failure');
|
|||||||
>
|
>
|
||||||
<!-- Closing quote, revealed word by word in the outro letterbox at sunrise. -->
|
<!-- Closing quote, revealed word by word in the outro letterbox at sunrise. -->
|
||||||
<span v-if="closer" class="journey-world__credit">
|
<span v-if="closer" class="journey-world__credit">
|
||||||
<span class="journey-world__quote"><span
|
<span class="journey-world__quote"><template
|
||||||
v-for="(word, index) in closer.quote.split(' ')"
|
v-for="(word, index) in closer.quote.split(' ')"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
><span
|
||||||
class="journey-world__word"
|
class="journey-world__word"
|
||||||
:style="{ '--i': index }"
|
:style="{ '--i': index }"
|
||||||
>{{ word }}</span></span>
|
>{{ word }}</span>{{ ' ' }}</template></span>
|
||||||
<span class="journey-world__by">{{ closer.attribution }}</span>
|
<span class="journey-world__by">{{ closer.attribution }}</span>
|
||||||
</span>
|
</span>
|
||||||
<picture v-if="!posterFailed">
|
<picture v-if="!posterFailed">
|
||||||
|
|||||||
@@ -583,7 +583,6 @@ html:is([data-dawn='sunrise'], [data-dawn='day']) .journey-world::after { backgr
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
.journey-world__word + .journey-world__word { margin-inline-start: 0.28em; }
|
|
||||||
.journey-world__by {
|
.journey-world__by {
|
||||||
color: rgb(255 226 196 / 68%);
|
color: rgb(255 226 196 / 68%);
|
||||||
font: 600 0.66rem/1.2 var(--mono, ui-monospace, monospace);
|
font: 600 0.66rem/1.2 var(--mono, ui-monospace, monospace);
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ describe("SceneCanvas", () => {
|
|||||||
"There is more day to dawn. The sun is but a morning star.",
|
"There is more day to dawn. The sun is but a morning star.",
|
||||||
);
|
);
|
||||||
expect(words[3]!.attributes("style")).toContain("--i: 3");
|
expect(words[3]!.attributes("style")).toContain("--i: 3");
|
||||||
|
// Real spaces between the word spans, so copy and screen readers get words.
|
||||||
|
expect(wrapper.get(".journey-world__quote").element.textContent).toBe(
|
||||||
|
"There is more day to dawn. The sun is but a morning star. ",
|
||||||
|
);
|
||||||
expect(wrapper.get(".journey-world__by").text()).toBe("Henry David Thoreau, Walden");
|
expect(wrapper.get(".journey-world__by").text()).toBe("Henry David Thoreau, Walden");
|
||||||
expect(wrapper.get(".journey-world").element.contains(wrapper.get(".journey-world__credit").element)).toBe(true);
|
expect(wrapper.get(".journey-world").element.contains(wrapper.get(".journey-world__credit").element)).toBe(true);
|
||||||
wrapper.unmount();
|
wrapper.unmount();
|
||||||
|
|||||||
Reference in New Issue
Block a user