From ce16ce1f080ee361245f0d74e40fadc031d7e743 Mon Sep 17 00:00:00 2001 From: atanasster Date: Fri, 17 Jan 2020 10:31:06 -0500 Subject: [PATCH 1/3] remove dedent default and white space wrapping --- lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx b/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx index 709c161f22d2..46bc56972240 100644 --- a/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx +++ b/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx @@ -80,6 +80,7 @@ const Code = styled.code({ flex: 1, paddingRight: 0, opacity: 1, + whiteSpace: 'pre', }); export interface SyntaxHighlighterProps { @@ -104,7 +105,7 @@ export const SyntaxHighlighter: FunctionComponent = ({ copyable = false, bordered = false, padded = false, - format = true, + format = false, className = null, ...rest }) => { From cbb48bb6e3c69271d015dfe9c9508068a32ce19d Mon Sep 17 00:00:00 2001 From: atanasster Date: Sat, 18 Jan 2020 02:03:02 -0500 Subject: [PATCH 2/3] revert syntaxhighlighter, added Source.defaultProps.format = false --- lib/components/src/blocks/Source.tsx | 3 +++ lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/components/src/blocks/Source.tsx b/lib/components/src/blocks/Source.tsx index 582801087ed6..831f8057748e 100644 --- a/lib/components/src/blocks/Source.tsx +++ b/lib/components/src/blocks/Source.tsx @@ -69,4 +69,7 @@ const Source: FunctionComponent = props => { return {syntaxHighlighter}; }; +Source.defaultProps = { + format: false, +}; export { Source }; diff --git a/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx b/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx index 46bc56972240..cad1b5a4f643 100644 --- a/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx +++ b/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx @@ -105,7 +105,7 @@ export const SyntaxHighlighter: FunctionComponent = ({ copyable = false, bordered = false, padded = false, - format = false, + format = true, className = null, ...rest }) => { From 0bad835d42a707861f4ecec28d518f5322427676 Mon Sep 17 00:00:00 2001 From: atanasster Date: Sat, 18 Jan 2020 02:04:37 -0500 Subject: [PATCH 3/3] remove white space styling --- lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx b/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx index cad1b5a4f643..709c161f22d2 100644 --- a/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx +++ b/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx @@ -80,7 +80,6 @@ const Code = styled.code({ flex: 1, paddingRight: 0, opacity: 1, - whiteSpace: 'pre', }); export interface SyntaxHighlighterProps {