@@ -18,6 +18,30 @@ function stripH1(content) {
1818 return content . replace ( / ^ # \s + .* \n ? / , '' ) . trim ( )
1919}
2020
21+ function stripRealmIdentifiers ( content ) {
22+ if ( ! content ) return ''
23+ return content
24+ . replace ( / < d i v c l a s s = " r e a l m - [ ^ " ] + " > / g, '' )
25+ . replace ( / < d i v c l a s s = " r e a l m - h e a d e r " > [ ^ < ] + < \/ d i v > / g, '' )
26+ . replace ( / < d i v c l a s s = " d e t a i l s - c o n t e n t " > / g, '' )
27+ . replace ( / < \/ d i v > / g, ( match , offset , str ) => {
28+ // Basic check to only remove divs that were likely our wrappers
29+ // This is a bit naive but works for the common case
30+ return ''
31+ } )
32+ . trim ( )
33+ }
34+
35+ function stripWrappers ( content ) {
36+ // More robust stripping of our specific containers
37+ let cleaned = stripH1 ( content )
38+ cleaned = cleaned . replace ( / < d i v c l a s s = " r e a l m - [ ^ " ] + " > / g, '' )
39+ cleaned = cleaned . replace ( / < d i v c l a s s = " r e a l m - h e a d e r " > [ ^ < ] * < \/ d i v > / g, '' )
40+ cleaned = cleaned . replace ( / < d i v c l a s s = " d e t a i l s - c o n t e n t " > / g, '' )
41+ cleaned = cleaned . replace ( / < \/ d i v > / g, '' )
42+ return cleaned . trim ( )
43+ }
44+
2145function getChangelog ( folder ) {
2246 const changelogPath = path . join ( docsModulesDir , folder , 'changelog.md' )
2347 if ( fs . existsSync ( changelogPath ) ) {
@@ -78,14 +102,17 @@ function main() {
78102 }
79103 } )
80104
81- let markdown = '# List of Modules\n\n'
105+ let markdown = '# Modules\n\n'
82106
83107 const categories = [ 'Modules' , 'Droppers' ]
84108 categories . forEach ( category => {
85109 const mods = grouped [ category ]
86110 if ( mods . length === 0 && category === 'Droppers' ) return
87111
88- markdown += `## ${ category } \n\n`
112+ if ( category !== 'Modules' ) {
113+ markdown += `## ${ category } \n\n`
114+ }
115+
89116 if ( mods . length === 0 ) {
90117 markdown += 'No modules found.\n\n'
91118 return
@@ -105,7 +132,7 @@ function main() {
105132 markdown += `<details id="${ slug } ">\n<summary>${ name } </summary>\n\n`
106133
107134 if ( about ) {
108- markdown += `### About\n\n ${ stripH1 ( about ) } \n\n`
135+ markdown += `${ stripWrappers ( about ) } \n\n`
109136 } else {
110137 markdown += `- **Description**: ${ description } \n`
111138 }
0 commit comments