Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src-docs/src/views/code/code_block_pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export default () => (
paddingSize="m"
color="dark"
overflowHeight={300}
whiteSpace="pre"
isCopyable>
<div>
When the whiteSpace property is set to pre all the whitespaces will be kept as is and the text only wraps when line breaks are in the content.
In this example, the whiteSpace property is set to pre. All the whitespaces will be kept as is and the text only wraps when line breaks are in the content.
</div>
</EuiCodeBlock>

Expand Down
9 changes: 6 additions & 3 deletions src-docs/src/views/code/code_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const CodeExample = {
demo: <CodeBlock />,
},
{
title: 'CodeBlock with pre white space',
title: 'CodeBlock and white-space',
source: [
{
type: GuideSectionTypes.JS,
Expand All @@ -85,8 +85,11 @@ export const CodeExample = {
],
text: (
<p>
<EuiCode>EuiCodeBlock</EuiCode> allows whiteSpace property to be set
allowing user to breaks/white space forcefuly or not.
By default, the <EuiCode>whiteSpace</EuiCode> property is set to{' '}
<EuiCode>pre-wrap</EuiCode>. This makes the text wrap when needed. You
can, however, pass <EuiCode>pre</EuiCode> to the{' '}
<EuiCode>whiteSpace</EuiCode> prop and the text won&apos;t wrap unless
line breaks are in the content.
</p>
),
props: { EuiCodeBlockImpl },
Expand Down