feat: now supports minheaders flag#142
Open
benjamincharity wants to merge 1 commit intothlorenz:masterfrom
Open
feat: now supports minheaders flag#142benjamincharity wants to merge 1 commit intothlorenz:masterfrom
benjamincharity wants to merge 1 commit intothlorenz:masterfrom
Conversation
Collaborator
PeterDaveHello
left a comment
There was a problem hiding this comment.
Is it possible that we can get some help from the latest LLM models to add some tests for it?
Contributor
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 suggestion.
Comments skipped due to low confidence (2)
lib/transform.js:117
- [nitpick] The variable name minHeadersLevelHtml is inconsistent with the parameter name minHeadersLevel. It should be renamed to minHeadersLevel.
var minHeadersLevelHtml = minHeadersLevel || 0;
lib/transform.js:138
- [nitpick] The variable name minHeadersLevelHtml is inconsistent with the parameter name minHeadersLevel. It should be renamed to minHeadersLevel.
var lessHeadersThanMin = linkedHeaders.length < minHeadersLevelHtml;
| var maxHeaderLevel = argv.m || argv.maxlevel; | ||
| if (maxHeaderLevel && isNaN(maxHeaderLevel) || maxHeaderLevel < 0) { console.error('Max. heading level specified is not a positive number: ' + maxHeaderLevel), printUsageAndExit(true); } | ||
|
|
||
| var minHeadersLevel = argv.m || argv.minheaders; |
There was a problem hiding this comment.
The variable 'minHeadersLevel' is assigned using 'argv.m', which is already used for 'maxHeaderLevel'. This could lead to unexpected behavior. Consider using a different variable for 'minHeadersLevel'.
Suggested change
| var minHeadersLevel = argv.m || argv.minheaders; | |
| var minHeadersLevel = argv.n || argv.minheaders; |
Contributor
|
@PeterDaveHello / @benjamincharity i have tackled this as #303 including adding additional test cases. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
doctoc —minheaders X .will only generate a TOC if at least X headings existNOTE: Functionally this is complete; but I have not yet added tests. I am not very familiar with this testing format and one test already seems to be failing (prior to my change). Any help/direction here would be appreciated! 🙏
Closes: #141