Skip to content

Commit a34a413

Browse files
authored
Merge pull request #11 from github/ncalteen/md
Add handling for unintended header matches
2 parents 0b8f66e + b674008 commit a34a413

14 files changed

+478
-119
lines changed

__fixtures__/extra/issue.md

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,72 @@
1-
### Model Name
1+
### The Name of the Thing
22

3-
### Model Description
3+
this-thing
44

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

7-
### Ersilia ID
7+
thing
88

9-
None
9+
### The Color of the Thing
1010

11-
### This is an extra field
11+
blue
1212

13-
The following link is just an example:
13+
### The Shape of the Thing
1414

15-
`www.example.com`
15+
square
1616

17-
### Code
17+
### The Sounds of the Thing
1818

19-
None
19+
re, mi
2020

21-
### License
21+
### The Topics About the Thing
22+
23+
_No response_
24+
25+
### The Description of the Thing
26+
27+
This is a description.
28+
29+
It has multiple lines.
30+
31+
It's pretty cool!
32+
33+
### This is an extra header someone included in the previous field
34+
35+
If the form template is included, this will be added to the parsed
36+
`description` field.
37+
38+
Otherwise, a new field should be added.
39+
40+
### The Notes About the Thing
41+
42+
- Note
43+
- Another note
44+
- Lots of notes
45+
46+
### The Code of the Thing
47+
48+
const thing = new Thing()
49+
thing.doThing()
50+
51+
### The String Method of the Code of the Thing
52+
53+
thing.toString()
54+
55+
### Is the Thing a Thing?
56+
57+
- [x] Yes
58+
- [ ] No
59+
60+
### Is the Thing Useful?
61+
62+
- [ ] Yes
63+
- [x] Sometimes
64+
- [ ] No
65+
66+
### Read Team
67+
68+
IssueOps-Demo-Readers
69+
70+
### Write Team
71+
72+
IssueOps-Demo-Writers
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"the_name_of_the_thing": "this-thing",
3+
"the_nickname_of_the_thing": "thing",
4+
"the_color_of_the_thing": "blue",
5+
"the_shape_of_the_thing": "square",
6+
"the_sounds_of_the_thing": "re, mi",
7+
"the_topics_about_the_thing": "_No response_",
8+
"the_description_of_the_thing": "This is a description.\n\nIt has multiple lines.\n\nIt's pretty cool!",
9+
"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.",
10+
"the_notes_about_the_thing": "- Note\n- Another note\n- Lots of notes",
11+
"the_code_of_the_thing": "const thing = new Thing()\nthing.doThing()",
12+
"the_string_method_of_the_code_of_the_thing": "thing.toString()",
13+
"is_the_thing_a_thing": "- [x] Yes\n- [ ] No",
14+
"is_the_thing_useful": "- [ ] Yes\n- [x] Sometimes\n- [ ] No",
15+
"read_team": "IssueOps-Demo-Readers",
16+
"write_team": "IssueOps-Demo-Writers"
17+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "this-thing",
3+
"nickname": "thing",
4+
"color": ["blue"],
5+
"shape": ["square"],
6+
"sounds": ["re", "mi"],
7+
"topics": [],
8+
"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.",
9+
"notes": "- Note\n- Another note\n- Lots of notes",
10+
"code": "const thing = new Thing()\nthing.doThing()",
11+
"code-string": "thing.toString()",
12+
"is-thing": {
13+
"selected": ["Yes"],
14+
"unselected": ["No"]
15+
},
16+
"is-thing-useful": {
17+
"selected": ["Sometimes"],
18+
"unselected": ["Yes", "No"]
19+
},
20+
"read-team": "IssueOps-Demo-Readers",
21+
"write-team": "IssueOps-Demo-Writers"
22+
}

__fixtures__/extra/parsed-issue.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,90 @@
11
{
2-
"name": { "label": "Model Name", "type": "input", "required": true },
3-
"description": {
4-
"label": "Model Description",
2+
"name": {
3+
"label": "The Name of the Thing",
4+
"type": "input",
5+
"required": true
6+
},
7+
"nickname": {
8+
"label": "The Nickname of the Thing",
59
"type": "input",
610
"required": false
711
},
8-
"id": {
9-
"label": "Ersilia ID",
12+
"color": {
13+
"label": "The Color of the Thing",
1014
"type": "dropdown",
1115
"required": true,
1216
"multiple": false,
13-
"options": ["abc123", "def456"]
17+
"options": [
18+
"blue",
19+
"black",
20+
"green",
21+
"orange",
22+
"purple",
23+
"red",
24+
"white",
25+
"yellow"
26+
]
27+
},
28+
"shape": {
29+
"label": "The Shape of the Thing",
30+
"type": "dropdown",
31+
"required": false,
32+
"multiple": false,
33+
"options": ["circle", "square", "triangle"]
1434
},
15-
"publication": {
16-
"label": "Publication",
35+
"sounds": {
36+
"label": "The Sounds of the Thing",
37+
"type": "dropdown",
38+
"required": true,
39+
"multiple": true,
40+
"options": ["do", "re", "mi", "fa", "so", "la", "ti"]
41+
},
42+
"topics": {
43+
"label": "The Topics About the Thing",
44+
"type": "dropdown",
45+
"required": false,
46+
"multiple": true,
47+
"options": ["cool", "fun", "interesting", "neat"]
48+
},
49+
"description": {
50+
"label": "The Description of the Thing",
51+
"type": "textarea",
52+
"required": true
53+
},
54+
"notes": {
55+
"label": "The Notes About the Thing",
1756
"type": "textarea",
1857
"required": false
1958
},
2059
"code": {
21-
"label": "Code",
22-
"type": "dropdown",
23-
"required": true,
24-
"multiple": false,
25-
"options": ["123abc", "456def"]
60+
"label": "The Code of the Thing",
61+
"type": "textarea",
62+
"required": true
63+
},
64+
"code-string": {
65+
"label": "The String Method of the Code of the Thing",
66+
"type": "textarea",
67+
"required": false
68+
},
69+
"is-thing": {
70+
"label": "Is the Thing a Thing?",
71+
"type": "checkboxes",
72+
"required": false,
73+
"options": [
74+
{ "label": "Yes", "required": true },
75+
{ "label": "No", "required": false }
76+
]
77+
},
78+
"is-thing-useful": {
79+
"label": "Is the Thing Useful?",
80+
"type": "checkboxes",
81+
"required": false,
82+
"options": [
83+
{ "label": "Yes", "required": false },
84+
{ "label": "Sometimes", "required": false },
85+
{ "label": "No", "required": false }
86+
]
2687
},
27-
"license": { "label": "License", "type": "input", "required": true }
88+
"read-team": { "label": "Read Team", "type": "input", "required": true },
89+
"write-team": { "label": "Write Team", "type": "input", "required": true }
2890
}

0 commit comments

Comments
 (0)