@@ -28,7 +28,8 @@ const createQueries = () => {
2828 const addYAMLMetadata = ( node , apiEntryMetadata ) => {
2929 const sanitizedString = node . value . replace (
3030 createQueries . QUERIES . yamlInnerContent ,
31- ( _ , __ , inner ) => inner
31+ // Either capture a YAML multinline block, or a simple single-line YAML block
32+ ( _ , simple , yaml ) => simple || yaml
3233 ) ;
3334
3435 apiEntryMetadata . updateProperties ( parseYAMLIntoMetadata ( sanitizedString ) ) ;
@@ -175,13 +176,13 @@ createQueries.QUERIES = {
175176 normalizeTypes : / ( \{ | < ) (? ! ) [ a - z A - Z 0 - 9 . | \[ \] \\ ] + (? ! ) ( \} | > ) / g,
176177 // ReGex to match the type API type references that got already parsed
177178 // so that they can be transformed into HTML links
178- linksWithTypes : / \[ ` < ( [ a - z A - Z 0 - 9 . | \\ [ \] ] + ) > ` \] \( ( . * ) \) / ,
179+ linksWithTypes : / \[ ` < ( [ a - z A - Z 0 - 9 . | \\ [ \] ] + ) > ` \] \( ( \S + ) \) / g ,
179180 // ReGeX for handling Stability Indexes Metadata
180181 stabilityIndex : / ^ S t a b i l i t y : ( [ 0 - 5 ] ) (?: \s * - \s * ) ? ( .* ) $ / s,
181182 // ReGeX for handling the Stability Index Prefix
182183 stabilityIndexPrefix : / S t a b i l i t y : ( [ 0 - 5 ] ) / ,
183184 // ReGeX for retrieving the inner content from a YAML block
184- yamlInnerContent : / ^ < ! - - ( Y A M L | Y A M L ) ? ( [ \s \S ] * ?) - - > / ,
185+ yamlInnerContent : / ^ < ! - - [ ] ? (?: Y A M L ( [ \s \S ] * ?) | ( [ \S ] * ? ) ) ? [ ] ? - - > / ,
185186} ;
186187
187188createQueries . UNIST = {
0 commit comments