From ea6706a2afd0870518bb5f211bb49a5b79407291 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 18 Apr 2018 15:28:36 +0900 Subject: Improve rendering of type definition comments --- .../react-docs/src/components/type_definition.tsx | 40 +++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'packages/react-docs/src') diff --git a/packages/react-docs/src/components/type_definition.tsx b/packages/react-docs/src/components/type_definition.tsx index 7a1c86da5..6d24145a1 100644 --- a/packages/react-docs/src/components/type_definition.tsx +++ b/packages/react-docs/src/components/type_definition.tsx @@ -122,7 +122,9 @@ export class TypeDefinition extends React.Component
- {customType.comment && } + {customType.comment && ( + + )}
); @@ -132,4 +134,40 @@ export class TypeDefinition extends React.Component { + if (i === 0 || i === segments.length - 1) { + return; + } + const words = s.split(' '); + const property = words[words.length - 1]; + words[words.length - 1] = `\n\n${property}`; + segments[i] = words.join(' '); + }); + const final = segments.join(PROPERTY_DESCRIPTION_DIVIDER); + return final; + } } -- cgit