From ce93941cf25c2e439fd327bd407fcad688c749eb Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Tue, 2 Sep 2025 12:55:36 +0100 Subject: [PATCH] Merge pull request #28245 from overleaf/mj-word-count-client-fix [web] Fix node skipping while waiting for magic comment GitOrigin-RevId: 8203e7d0779e660d5f6e568b78b0df6d18bfaf58 --- .../js/features/word-count-modal/utils/count-words-in-file.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/frontend/js/features/word-count-modal/utils/count-words-in-file.ts b/services/web/frontend/js/features/word-count-modal/utils/count-words-in-file.ts index a917d54014..a57f7a84fb 100644 --- a/services/web/frontend/js/features/word-count-modal/utils/count-words-in-file.ts +++ b/services/web/frontend/js/features/word-count-modal/utils/count-words-in-file.ts @@ -303,7 +303,7 @@ export const countWordsInFile = ( to: preambleExtent.to, enter(nodeRef: SyntaxNodeRef) { if (state.skipping && !nodeRef.type.is('Comment')) { - return false + return } return headMatcher(nodeRef.type)?.(nodeRef) }, @@ -313,7 +313,7 @@ export const countWordsInFile = ( from: preambleExtent.to, enter(nodeRef: SyntaxNodeRef) { if (state.skipping && !nodeRef.type.is('Comment')) { - return false + return } return bodyMatcher(nodeRef.type)?.(nodeRef) },