Skip to content

Add handling for unintended header matches #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 62 additions & 11 deletions __fixtures__/extra/issue.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,72 @@
### Model Name
### The Name of the Thing

### Model Description
this-thing

who's molecule is this? (we don't know)
### The Nickname of the Thing

### Ersilia ID
thing

None
### The Color of the Thing

### This is an extra field
blue

The following link is just an example:
### The Shape of the Thing

`www.example.com`
square

### Code
### The Sounds of the Thing

None
re, mi

### License
### The Topics About the Thing

_No response_

### The Description of the Thing

This is a description.

It has multiple lines.

It's pretty cool!

### This is an extra header someone included in the previous field

If the form template is included, this will be added to the parsed
`description` field.

Otherwise, a new field should be added.

### The Notes About the Thing

- Note
- Another note
- Lots of notes

### The Code of the Thing

const thing = new Thing()
thing.doThing()

### The String Method of the Code of the Thing

thing.toString()

### Is the Thing a Thing?

- [x] Yes
- [ ] No

### Is the Thing Useful?

- [ ] Yes
- [x] Sometimes
- [ ] No

### Read Team

IssueOps-Demo-Readers

### Write Team

IssueOps-Demo-Writers
17 changes: 17 additions & 0 deletions __fixtures__/extra/parsed-issue-no-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"the_name_of_the_thing": "this-thing",
"the_nickname_of_the_thing": "thing",
"the_color_of_the_thing": "blue",
"the_shape_of_the_thing": "square",
"the_sounds_of_the_thing": "re, mi",
"the_topics_about_the_thing": "_No response_",
"the_description_of_the_thing": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!",
"this_is_an_extra_header_someone_included_in_the_previous_field": "If the form template is included, this will be added to the parsed\n`description` field.\n\nOtherwise, a new field should be added.",
"the_notes_about_the_thing": "- Note\n- Another note\n- Lots of notes",
"the_code_of_the_thing": "const thing = new Thing()\nthing.doThing()",
"the_string_method_of_the_code_of_the_thing": "thing.toString()",
"is_the_thing_a_thing": "- [x] Yes\n- [ ] No",
"is_the_thing_useful": "- [ ] Yes\n- [x] Sometimes\n- [ ] No",
"read_team": "IssueOps-Demo-Readers",
"write_team": "IssueOps-Demo-Writers"
}
22 changes: 22 additions & 0 deletions __fixtures__/extra/parsed-issue-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "this-thing",
"nickname": "thing",
"color": ["blue"],
"shape": ["square"],
"sounds": ["re", "mi"],
"topics": [],
"description": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!\n\n### This is an extra header someone included in the previous field\n\nIf the form template is included, this will be added to the parsed\n`description` field.\n\nOtherwise, a new field should be added.",
"notes": "- Note\n- Another note\n- Lots of notes",
"code": "const thing = new Thing()\nthing.doThing()",
"code-string": "thing.toString()",
"is-thing": {
"selected": ["Yes"],
"unselected": ["No"]
},
"is-thing-useful": {
"selected": ["Sometimes"],
"unselected": ["Yes", "No"]
},
"read-team": "IssueOps-Demo-Readers",
"write-team": "IssueOps-Demo-Writers"
}
6 changes: 0 additions & 6 deletions __fixtures__/extra/parsed-issue.json

This file was deleted.

90 changes: 76 additions & 14 deletions __fixtures__/extra/parsed-template.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,90 @@
{
"name": { "label": "Model Name", "type": "input", "required": true },
"description": {
"label": "Model Description",
"name": {
"label": "The Name of the Thing",
"type": "input",
"required": true
},
"nickname": {
"label": "The Nickname of the Thing",
"type": "input",
"required": false
},
"id": {
"label": "Ersilia ID",
"color": {
"label": "The Color of the Thing",
"type": "dropdown",
"required": true,
"multiple": false,
"options": ["abc123", "def456"]
"options": [
"blue",
"black",
"green",
"orange",
"purple",
"red",
"white",
"yellow"
]
},
"shape": {
"label": "The Shape of the Thing",
"type": "dropdown",
"required": false,
"multiple": false,
"options": ["circle", "square", "triangle"]
},
"publication": {
"label": "Publication",
"sounds": {
"label": "The Sounds of the Thing",
"type": "dropdown",
"required": true,
"multiple": true,
"options": ["do", "re", "mi", "fa", "so", "la", "ti"]
},
"topics": {
"label": "The Topics About the Thing",
"type": "dropdown",
"required": false,
"multiple": true,
"options": ["cool", "fun", "interesting", "neat"]
},
"description": {
"label": "The Description of the Thing",
"type": "textarea",
"required": true
},
"notes": {
"label": "The Notes About the Thing",
"type": "textarea",
"required": false
},
"code": {
"label": "Code",
"type": "dropdown",
"required": true,
"multiple": false,
"options": ["123abc", "456def"]
"label": "The Code of the Thing",
"type": "textarea",
"required": true
},
"code-string": {
"label": "The String Method of the Code of the Thing",
"type": "textarea",
"required": false
},
"is-thing": {
"label": "Is the Thing a Thing?",
"type": "checkboxes",
"required": false,
"options": [
{ "label": "Yes", "required": true },
{ "label": "No", "required": false }
]
},
"is-thing-useful": {
"label": "Is the Thing Useful?",
"type": "checkboxes",
"required": false,
"options": [
{ "label": "Yes", "required": false },
{ "label": "Sometimes", "required": false },
{ "label": "No", "required": false }
]
},
"license": { "label": "License", "type": "input", "required": true }
"read-team": { "label": "Read Team", "type": "input", "required": true },
"write-team": { "label": "Write Team", "type": "input", "required": true }
}
Loading
Loading