diff --git a/lib/get-text.js b/lib/get-text.js index ed85364f..c66e9e64 100644 --- a/lib/get-text.js +++ b/lib/get-text.js @@ -303,9 +303,7 @@ export default class GetText { if ( !single.id && !plural.id ) return; // extracted comments - const comment = this.#extractNodeComment( ast, node ); - - if ( comment ) var extractedComments = [ comment ]; + const extractedComments = this.#extractNodeComment( ast, node ); if ( single.id ) { this.#poFile.addEctractedMessages( { @@ -392,7 +390,7 @@ export default class GetText { } } - return comments.join( "\n" ); + if ( comments.length ) return [ comments.join( "\n" ) ]; } #getNodeLocation ( node, { start } = {} ) {