Open colindean opened 1 year ago
To be clearer,
## Status
- Accepted
works but
## Status
- [ ] Accepted
does not.
Ideally, I'd like to have something like this work:
## Status
- [X] Pending
- [X] Accepted
- [ ] Amended
- [ ] Superceded
should result in accepted
status.
## Status
- [X] Pending
- [X] Accepted
- [ ] Amended
- [X] Superceded
should result in superceded
, and so on. We tend to add dates after these but the startswith()
check handles that.
So, if the check box is present, use the last checked.
The current status resolver mechanism adequately accounts for lists in the Status H2 but a list containing a checklist style list gets ignored because the square brackets remain.
https://github.com/mrwilson/adr-viewer/blob/f3d5fdc10471370e5f8d7b97b0b04b5e178ff74a/adr_viewer/__init__.py#L35-L44
This could be modified to use
needle in haystack
instead ofhaystack.startswith(needle)
, orhttps://github.com/mrwilson/adr-viewer/blob/f3d5fdc10471370e5f8d7b97b0b04b5e178ff74a/adr_viewer/__init__.py#L23
could handle the HTML better by removing
[ ]
or[X]
or[x]
that precedes text, or looks for text inside of the li (skipping input[type=checkbox] if present).