Repository navigation
Site.tsx export lost every quotation mark - #2
Merged
Merged
Conversation
Moving the testimonial quotes from the markup into `content: open-quote` fixed them for eight languages on screen and silently broke the React export, which reads the DOM and so cannot see a mark that only exists in a stylesheet. What came out was a component with no quotes at all and a `quoted` class pointing at a rule that does not ship with it — while the file's own header promises no dependency beyond React. The export now resolves generated content and writes it in as text: the quote keywords through the element's computed `quotes` pair, string literals as written, anything else (counters, attr, images) left alone. `quoted` joins `blk-in` among the class names stripped on the way out, for the same reason — both name rules the file does not carry. The marks go on the same line as the text they wrap. JSX collapses the newline between two pieces of text into a space, so the obvious version renders `「 like this 」`, which is wrong in every language that does not ask for a space and invisible unless you compare the strings. Verified by compiling the exported file with esbuild and rendering it with react-dom/server, then comparing the blockquote against what the page shows. German, French, Chinese and English all round-trip exactly, spaces included. The seven new tests supply pseudo-element styles jsdom will not compute, and all six mutations of the new code turn them red.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A regression from #1, found by exporting the thing rather than assuming it still worked.
Moving the testimonial quotes out of the markup and into
content: open-quotefixed them on screen for eight languages, and silently broke the React export. That exporter reads the rendered DOM, so a mark that exists only in a stylesheet is invisible to it. What came out was a component with zero quotation marks and aquotedclass pointing at a rule that does not ship with the file — while the file's own header promises no dependency beyond React.What changed
The export resolves CSS generated content and writes it in as text:
open-quote/close-quotethrough the element's computedquotespair, so German gets„…", French« … », Chinese「…」attr(), images — left alonequotedjoinsblk-inamong the class names stripped on the way out, for the same reason: both name rules the file does not carryThe marks land on the same line as the text they wrap. JSX collapses the newline between two pieces of text into a single space, so the obvious implementation renders
「 like this 」. That is wrong in every language that does not ask for a space, and invisible unless you compare the strings — French wants the space and would have passed a casual look.Verification
Not "it looks right". The exported file is compiled with esbuild and rendered with
react-dom/server, then the<blockquote>is compared against what the live page shows, computedquotesincluded:Seven new tests supply the pseudo-element styles jsdom will not compute. All six mutations of the new code turn them red, including the one that only breaks the spacing.
tsc --noEmitclean, 159 tests passing,npm run buildclean.