Skip to content

Commit

Permalink
One codeblock with line breaks when multiple functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Aug 19, 2020
1 parent a657af9 commit eb69f23
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src-docs/src/components/guide_section/guide_section.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,23 +358,29 @@ export class GuideSection extends Component {
for (let i = 0; i < types.length; i++) {
if (functionMatches[j]) {
elements.push(
<EuiCodeBlock {...codeBlockProps}>{types[i]}</EuiCodeBlock>
<Fragment>
{types[i]} <br />
</Fragment>
);
elements.push(
<EuiCodeBlock {...codeBlockProps}>
{functionMatches[j][0]}
</EuiCodeBlock>
<Fragment>
{functionMatches[j][0]} <br />
</Fragment>
);
j++;
} else {
elements.push(
<EuiCodeBlock {...codeBlockProps}>{types[i]}</EuiCodeBlock>
<Fragment>
{types[i]} <br />
</Fragment>
);
}
}
defaultTypeCell = (
<EuiTableRowCell key="type" header="Type" textOnly={false}>
<div>{elements}</div>
<EuiCodeBlock whiteSpace="pre" {...codeBlockProps}>
{elements}
</EuiCodeBlock>
</EuiTableRowCell>
);
}
Expand Down

0 comments on commit eb69f23

Please sign in to comment.