File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ function createLabel(label) {
117117 return `<label class="api-type-label ${ label } ">${ label } </label>` ;
118118}
119119
120+ const DIRECTIVE_REGEX = / ^ \[ [ a - z A - Z - ] + \] / ;
120121const STANDALONE_SUFFIX_REGEX = / : s t a n d a l o n e $ / ;
121122
122123/**
@@ -141,7 +142,7 @@ function normalizeHead(text) {
141142renderer . heading = function ( text , level ) {
142143 const lowerText = text . toLowerCase ( ) . replace ( / / g, '-' ) . replace ( / \. / g, '-' ) . replace ( / \? / g, '' ) ;
143144 const isMarkedLabel = level === 3 && text . indexOf ( 'nz-' ) === 0 ;
144- const isDirective = text [ 0 ] === '[' && text [ text . length - 1 ] === ']' ;
145+ const isDirective = DIRECTIVE_REGEX . test ( text ) ;
145146 const isComponent = isMarkedLabel && ! isDirective ;
146147 const isStandalone = STANDALONE_SUFFIX_REGEX . test ( text ) ;
147148 const isService = text . indexOf ( 'Nz' ) === 0 && text . indexOf ( 'Service' ) > - 1 ;
You can’t perform that action at this time.
0 commit comments