namanjain24-sudo opened a new pull request, #73574:
URL: https://github.com/apache/airflow/pull/73574
closes: #73537
## What happened
`RenderedTemplates` (the "Rendered Templates" tab) renders each field's
value through
`react-syntax-highlighter` with both `showLineNumbers` and `wrapLongLines`
set. With
both on, the library sets each line's wrapper `<span>` to `display: flex` so
the line
number and the wrapped content sit side by side.
Browsers insert a line break between flex items when you copy plain text
that spans
them. Since each Prism token (often a single word or piece of punctuation)
is a flex
item inside that span, a manual select-and-copy of the rendered SQL pastes
with almost
every token on its own line.
This combination previously forced each line back to `display: block` via
`lineProps`,
added in #66221 for the same symptom. #63492 (wrapping long lines) dropped
that prop
while switching `PreTag` from `div` to `pre`, which reintroduced the bug.
## What changes are included in this PR
Restores `lineProps={{ style: { display: "block" } }}` on the
`SyntaxHighlighter` in
`RenderedTemplates.tsx`, overriding the library's flex layout back to block
per line.
## Testing
Added `RenderedTemplates.test.tsx`, asserting every rendered line span is
`display: block`. Confirmed it fails with `display: flex` when the fix is
reverted, and
passes with it applied. Also ran `tsc --noEmit` and `eslint` on the changed
files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]