fix(styles) restore wrapping of long text in pre blocks #6377
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.
Description
Adds
overflow-wrap: break-word
to<pre>
blocks in markdown.Motivation and Context
In Swagger UI version 3.24.1 (November 2019) a CSS change was made to
_layout.scss
that added the.microlight
class to the.opblock-body pre
selector. (#5673)Prior to this change, a
<pre>
block in an operation description that contained long text content with no spaces or other natural break points would automatically wrap onto new lines, because the.opblock-body pre
selector (now.opblock-body pre.microlight
) includesoverflow-wrap: break-word
.After the above change, this CSS selector no longer applies to
<pre>
blocks in the description, causing long unbroken text to overflow out of the right edge of the container.(see screenshots below for before & after).
This change adds the
overflow-wrap: break-word
style to the.markdown pre
and.renderedMarkdown pre
selectors, to restore the previous wrapping behaviour for long unbroken text to what it was prior to v3.24.1.How Has This Been Tested?
Manually tested in local dev environment by loading an API definition with a long unbroken
<pre>
block, and visually confirmed the wrapping before and after the change (see screenshots).Screenshots (if appropriate):
How it currently appears since v3.24.1 and prior to merging this PR:
How it previously appeared prior to v3.24.1, and how it will appear after merging this PR:
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests