Skip to content

Commit

Permalink
Change checkbox to handle lowercase (#199)
Browse files Browse the repository at this point in the history
* Change checkbox to handle lowercase

* Update tests to check for lower case 'X' on checkboxes

---------

Co-authored-by: Eduardo Serrano <eduardomserrano@outlook.com>
  • Loading branch information
rpond21 and edumserrano authored Aug 30, 2024
1 parent 5aef824 commit f4e7864
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ private static List<IssueFormCheckboxOption> CreateCheckboxOptions(string option
.TrimIssueText();
isChecked = true;
}
else if (optionText.StartsWith("- [x]", StringComparison.Ordinal))
{
label = optionText
.TrimStart([.. "- [x]"])
.TrimIssueText();
isChecked = true;
}
else if (optionText.StartsWith("- [ ]", StringComparison.Ordinal))
{
label = optionText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public async Task TemplateFilepathOptionValidation2()

/// <summary>
/// Tests the correct value for the options that can be used with the 'parse-issue-form' command.
/// This test uses an issue body where the checkboxes use both an Uppercase and Lowercase 'X' or aren't
/// checked.
/// </summary>
[Theory]
[InlineData("-i", "-t")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Another line:
### Which operating systems have you used?

- [X] macOS
- [X] Windows
- [x] Windows
- [ ] Linux
- [ ] I don't know

0 comments on commit f4e7864

Please sign in to comment.