@@ -102,13 +102,17 @@ export const createSectionBuilder = () => {
102102 * @param {Array } nodes - The remaining AST nodes.
103103 * @param {import('../types.d.ts').HierarchizedEntry } entry - The entry providing stability information.
104104 */
105- const parseStability = ( section , nodes , { stability } ) => {
106- const stabilityInfo = stability . children . map ( node => node . data ) ?. [ 0 ] ;
105+ const parseStability = ( section , nodes , { stability, content } ) => {
106+ const stabilityNode = stability . children [ 0 ] ;
107107
108- if ( stabilityInfo ) {
109- section . stability = Number ( stabilityInfo . index ) ;
110- section . stabilityText = stabilityInfo . description ;
111- nodes . shift ( ) ; // Remove stability node from processing
108+ if ( stabilityNode ) {
109+ section . stability = Number ( stabilityNode . data . index ) ;
110+ section . stabilityText = stabilityNode . data . description ;
111+
112+ const nodeToRemove = content . children . findIndex (
113+ ( { data } ) => data === stabilityNode . data
114+ ) ;
115+ nodes . splice ( nodeToRemove - 1 , 1 ) ;
112116 }
113117 } ;
114118
@@ -153,7 +157,10 @@ export const createSectionBuilder = () => {
153157 * @param {import('../types.d.ts').Section } parent - The parent section.
154158 */
155159 const addToParent = ( section , parent ) => {
156- const key = SECTION_TYPE_PLURALS [ section . type ] || 'miscs' ;
160+ const key =
161+ SECTION_TYPE_PLURALS [ section . __promote ?? section . type ] || 'miscs' ;
162+
163+ delete section . __promote ;
157164
158165 parent [ key ] ??= [ ] ;
159166 parent [ key ] . push ( section ) ;
0 commit comments