@@ -98,13 +98,20 @@ function createItems(
9898 openapiData . tags ?? [ ]
9999 ) ;
100100 const tagId = kebabCase ( tag . name ) ;
101+ const splitDescription = description . match ( / [ ^ \r \n ] + / g) ;
101102 const tagPage : PartialPage < TagPageMetadata > = {
102103 type : "tag" ,
103104 id : tagId ,
104105 unversionedId : tagId ,
105106 title : description ?? "" ,
106107 description : description ?? "" ,
107- frontMatter : { } ,
108+ frontMatter : {
109+ description : splitDescription
110+ ? splitDescription [ 0 ]
111+ . replace ( / ( (?: ^ | [ ^ \\ ] ) (?: \\ { 2 } ) * ) " / g, "$1'" )
112+ . replace ( / \s + $ / , "" )
113+ : "" ,
114+ } ,
108115 tag : {
109116 ...tag ,
110117 } ,
@@ -115,6 +122,11 @@ function createItems(
115122
116123 if ( openapiData . info . description ) {
117124 // Only create an info page if we have a description.
125+ const infoDescription = openapiData . info ?. description ;
126+ let splitDescription : any ;
127+ if ( infoDescription ) {
128+ splitDescription = infoDescription . match ( / [ ^ \r \n ] + / g) ;
129+ }
118130 const infoPage : PartialPage < InfoPageMetadata > = {
119131 type : "info" ,
120132 id : infoId ,
@@ -126,7 +138,13 @@ function createItems(
126138 "$1'"
127139 )
128140 : "" ,
129- frontMatter : { } ,
141+ frontMatter : {
142+ description : splitDescription
143+ ? splitDescription [ 0 ]
144+ . replace ( / ( (?: ^ | [ ^ \\ ] ) (?: \\ { 2 } ) * ) " / g, "$1'" )
145+ . replace ( / \s + $ / , "" )
146+ : "" ,
147+ } ,
130148 securitySchemes : openapiData . components ?. securitySchemes ,
131149 info : {
132150 ...openapiData . info ,
@@ -208,6 +226,12 @@ function createItems(
208226 }
209227 }
210228
229+ const opDescription = operationObject . description ;
230+ let splitDescription : any ;
231+ if ( opDescription ) {
232+ splitDescription = opDescription . match ( / [ ^ \r \n ] + / g) ;
233+ }
234+
211235 const apiPage : PartialPage < ApiPageMetadata > = {
212236 type : "api" ,
213237 id : baseId ,
@@ -220,7 +244,13 @@ function createItems(
220244 "$1'"
221245 )
222246 : "" ,
223- frontMatter : { } ,
247+ frontMatter : {
248+ description : splitDescription
249+ ? splitDescription [ 0 ]
250+ . replace ( / ( (?: ^ | [ ^ \\ ] ) (?: \\ { 2 } ) * ) " / g, "$1'" )
251+ . replace ( / \s + $ / , "" )
252+ : "" ,
253+ } ,
224254 api : {
225255 ...defaults ,
226256 tags : operationObject . tags ,
0 commit comments