@@ -110,6 +110,11 @@ function process_function(text) {
110110 }
111111
112112 debug(" → function" )
113+ if (internal_section){
114+ debug(" → → function: contained in internal section, skip" )
115+ return
116+ }
117+
113118 if (is_internal) {
114119 debug(" → → function: it is internal, skip" )
115120 is_internal = 0
@@ -242,7 +247,6 @@ function reset() {
242247function reset_section () {
243248 debug(" → reset_section()" )
244249
245- delete section_docblock
246250 delete docblock_filter
247251 section = " "
248252 section_description = " "
@@ -475,6 +479,13 @@ function process_section() {
475479 debug(" → → no valid section name - skip" )
476480 return ;
477481 }
482+ if (is_internal){
483+ debug(" → → section marked as internal - skip" )
484+ internal_section = 1
485+ is_internal = 0
486+ reset_section();
487+ return ;
488+ }
478489
479490 debug(" → → section: [" section " ]" )
480491 debug(" → → section_description: [" section_description " ]" )
@@ -658,7 +669,12 @@ function debug(msg) {
658669
659670/^ [[:space :] ]* # @internal / {
660671 debug(" → @internal" )
661- is_internal = 1
672+ # ignore the flag while we are in an internal section
673+ # to prevent dangling values not reset by function blocks
674+ # because internal_section is checked first in process_function
675+ if (! internal_section){
676+ is_internal = 1
677+ }
662678
663679 next
664680}
@@ -713,13 +729,17 @@ in_description {
713729 section_description = " "
714730 section_active = 0
715731 function_nesting = 2
732+ internal_section = 0
716733
717734 next
718735}
719736
720737/^ [[:space :] ]* # @section / {
721738 debug(" → @section" )
722739 sub (/^ [[:space :] ]* # @section /, " " )
740+ if (internal_section){
741+ internal_section = 0
742+ }
723743 section = $0
724744 section_active = 1
725745 function_nesting = 3
@@ -729,10 +749,8 @@ in_description {
729749
730750/^ [[:space :] ]* # @example / {
731751 debug(" → @example" )
732-
733752 in_example = 1
734753
735-
736754 next
737755}
738756
0 commit comments