Skip to content

Commit 6a86074

Browse files
committed
chore: add comments
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent d6e689c commit 6a86074

File tree

1 file changed

+9
-1
lines changed
  • lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib

1 file changed

+9
-1
lines changed

lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ function linter( tree, file, options, clbk ) {
239239
debug( 'Popping section stack for combined section end+comment' );
240240
sectionStack.pop();
241241
}
242+
243+
// Do not fall through to other handlers once combined case is handled...
242244
return;
243245
}
244246

@@ -266,6 +268,8 @@ function linter( tree, file, options, clbk ) {
266268
}
267269

268270
sectionStack.push( data );
271+
272+
// Don't fall through and misinterpret this node as an end tag...
269273
return;
270274
}
271275

@@ -279,6 +283,8 @@ function linter( tree, file, options, clbk ) {
279283
msg = 'Orphaned section closing tag. Found </section> without a matching opening <section> tag. Remove this tag or add a corresponding opening tag.';
280284
errCode = 'orphaned-section-end';
281285
reportErr( file, node, msg, errCode );
286+
287+
// Since there is nothing to close, do not fall through to other end-handling logic...
282288
return;
283289
}
284290

@@ -323,6 +329,8 @@ function linter( tree, file, options, clbk ) {
323329
msg = 'Missing proper empty line after closing section tag. There should be an empty line between </section> and the closing comment.';
324330
errCode = 'missing-empty-line-after-section';
325331
reportErr( file, node, msg, errCode );
332+
333+
// Fall through to still check following comment and then close section...
326334
}
327335

328336
// Check if the following node is the expected comment:
@@ -355,7 +363,7 @@ function linter( tree, file, options, clbk ) {
355363
reportErr( file, node, msg, errCode );
356364
}
357365

358-
// Pop the section stack:
366+
// Fall-throughs above are intentional: regardless of errors, pop the section stack:
359367
sectionStack.pop();
360368
}
361369
}

0 commit comments

Comments
 (0)