Skip to content
7 changes: 6 additions & 1 deletion components/play-console/element.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ li {
}
}

code {
pre {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change causes long lines to no longer break:

Where Screenshot
Local image
Prod image

Maybe we should use neither code nor pre, and just set white-space: preserve?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just white-space: preserve isn't cutting it. The > and ####... are getting rendered on different lines.
We need <li> to not wrap and the text content to wrap. Let me know how the latest commit fares:

1

Code used

console.log("   abcd  d   c  ");
console.log("   abcd  \nd   c  ");
console.log("a".repeat(300));

display: inline-block;

margin: 0;

font-family: var(--font-family-code);

tab-size: 4;
}
4 changes: 1 addition & 3 deletions components/play-console/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ export class MDNPlayConsole extends LitElement {
render() {
return html`
<ul aria-live="polite">
${this._messages.map(
(message) => html`<li><code>${message}</code></li>`,
)}
${this._messages.map((message) => html`<li><pre>${message}</pre></li>`)}
</ul>
`;
}
Expand Down