Skip to content

Commit 0101e6e

Browse files
authored
fix: preserve trailing content after code comments in code output (#9196)
1 parent f3b0f9c commit 0101e6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/dev/s2-docs/src/Code.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function renderHast(node: HastNode | HastTextNode, key: string, links?: Links, i
228228

229229
// CodeProps includes the indent and newlines in case there are no props to show.
230230
if (node.tagName === 'div' && typeof childArray[0] === 'string' && /^\s+$/.test(childArray[0]) && React.isValidElement(childArray[1]) && childArray[1].type === CodeProps) {
231-
children = childArray[1];
231+
children = childArray.slice(1);
232232
}
233233

234234
let tagName: any = node.tagName;

0 commit comments

Comments
 (0)