Skip to content

Commit 588ebef

Browse files
authored
DOP-5114: Force inline literals to wrap (#1343)
1 parent dadb29b commit 588ebef

File tree

8 files changed

+20
-1
lines changed

8 files changed

+20
-1
lines changed

src/components/Literal.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ const inlineCodeStyling = css`
1717
}
1818
`;
1919

20+
const wordWrapStyle = css`
21+
word-wrap: break-word;
22+
white-space: unset;
23+
`;
24+
2025
const StyledNavigationInlineCode = styled('code')`
2126
/* Used for Literals that don't need LeafyGreen's InlineCode component */
2227
font-family: 'Source Code Pro';
@@ -28,7 +33,7 @@ const Literal = ({ nodeData: { children }, formatTextOptions }) => {
2833
const CurrInlineCode = navigationStyle ? StyledNavigationInlineCode : InlineCode;
2934

3035
return (
31-
<CurrInlineCode className={cx(navigationStyle ? '' : inlineCodeStyling)}>
36+
<CurrInlineCode className={cx(navigationStyle ? '' : inlineCodeStyling, wordWrapStyle)}>
3237
{children.map((node, i) => (
3338
<ComponentFactory nodeData={node} key={i} />
3439
))}

tests/unit/__snapshots__/DefinitionList.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ exports[`DefinitionList renders correctly 1`] = `
1919
display: inline;
2020
color: var(--font-color-primary);
2121
background: var(--background-color-secondary);
22+
word-wrap: break-word;
23+
white-space: unset;
2224
}
2325
2426
.lg-ui-0000:hover>.emotion-0 {

tests/unit/__snapshots__/Field.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ exports[`renders correctly 1`] = `
2020
display: inline;
2121
color: var(--font-color-primary);
2222
background: var(--background-color-secondary);
23+
word-wrap: break-word;
24+
white-space: unset;
2325
}
2426
2527
.lg-ui-0000:hover>.emotion-0 {

tests/unit/__snapshots__/FieldList.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ exports[`renders correctly 1`] = `
4141
display: inline;
4242
color: var(--font-color-primary);
4343
background: var(--background-color-secondary);
44+
word-wrap: break-word;
45+
white-space: unset;
4446
}
4547
4648
.lg-ui-0000:hover>.emotion-3 {

tests/unit/__snapshots__/Line.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ exports[`renders correctly 1`] = `
2929
display: inline;
3030
color: var(--font-color-primary);
3131
background: var(--background-color-secondary);
32+
word-wrap: break-word;
33+
white-space: unset;
3234
}
3335
3436
.lg-ui-0000:hover>.emotion-0 {

tests/unit/__snapshots__/Literal.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ exports[`renders correctly 1`] = `
1919
display: inline;
2020
color: var(--font-color-primary);
2121
background: var(--background-color-secondary);
22+
word-wrap: break-word;
23+
white-space: unset;
2224
}
2325
2426
.lg-ui-0000:hover>.emotion-0 {

tests/unit/__snapshots__/Target.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ exports[`renders correctly with a directive_argument node 1`] = `
1919
display: inline;
2020
color: var(--font-color-primary);
2121
background: var(--background-color-secondary);
22+
word-wrap: break-word;
23+
white-space: unset;
2224
}
2325
2426
.lg-ui-0000:hover>.emotion-0 {

tests/unit/__snapshots__/VersionModified.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ exports[`when rendering a deprecated directive with 0 arguments renders correctl
1919
display: inline;
2020
color: var(--font-color-primary);
2121
background: var(--background-color-secondary);
22+
word-wrap: break-word;
23+
white-space: unset;
2224
}
2325
2426
.lg-ui-0000:hover>.emotion-0 {

0 commit comments

Comments
 (0)