This repository was archived by the owner on Jul 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
plugins/plugin-client-common/src/components/Content/Markdown Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,18 @@ class LinkableTabs extends React.PureComponent<Props, State> {
103
103
className = "kui--markdown-tab"
104
104
title = { < TabTitleText > { _ . props . title } </ TabTitleText > }
105
105
>
106
- < Card className = "kui--markdown-tab-card" > { _ . props && _ . props . children } </ Card >
106
+ < Card className = "kui--markdown-tab-card" >
107
+ < React . Fragment > { _ . props && _ . props . children } </ React . Fragment >
108
+ </ Card >
107
109
</ Tab >
108
110
) ) }
109
111
</ Tabs >
110
112
)
113
+
114
+ // re: the <React.Fragment> wrapper around props.children; this is
115
+ // to avoid Card's PatternFly impl creating a separate Markdown
116
+ // component for every child. We know here that all of the children are part
117
+ // of the same contiguous stretch of text.
111
118
}
112
119
}
113
120
Original file line number Diff line number Diff line change @@ -116,13 +116,15 @@ export default function plugin(/* options */) {
116
116
position
117
117
} )
118
118
return newChildren
119
- } else if ( currentTabs . length > 0 ) {
120
- return addToTab ( pchild )
121
119
}
122
120
}
123
121
124
- newChildren . push ( pchild )
125
- return newChildren
122
+ if ( currentTabs . length > 0 ) {
123
+ return addToTab ( pchild )
124
+ } else {
125
+ newChildren . push ( pchild )
126
+ return newChildren
127
+ }
126
128
} , [ ] )
127
129
}
128
130
if ( currentTabs . length > 0 ) {
You can’t perform that action at this time.
0 commit comments