File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
generators/llms-txt/utils Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1+ nodejs 22.17.1
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ export const getEntryDescription = entry => {
1818 child => child . type === 'paragraph'
1919 ) ;
2020
21+ console . log ( descriptionNode ) ;
22+
2123 if ( ! descriptionNode ) {
2224 return '' ;
2325 }
Original file line number Diff line number Diff line change @@ -16,8 +16,14 @@ export const transformNodeToString = node => {
1616 return `**${ transformNodesToString ( node . children ) } **` ;
1717 case 'emphasis' :
1818 return `_${ transformNodesToString ( node . children ) } _` ;
19- default :
20- return node . children ? transformNodesToString ( node . children ) : node . value ;
19+ default : {
20+ if ( node . children ) {
21+ return transformNodesToString ( node . children ) ;
22+ }
23+
24+ // Replace line breaks (\n) with spaces to keep text in a single line
25+ return node . value ?. replace ( / \n / g, ' ' ) || '' ;
26+ }
2127 }
2228} ;
2329
You can’t perform that action at this time.
0 commit comments