Open t-eckert opened 3 years ago
This issue is also seen in PR #8.
The way I want to fix this is to modify Recipe.instructions
to be a str
instead of a list[str]
and let the Marko
markdown parser handle more of the work.
Currently, we parse in the children of list within a section and create a list of strings from that. Instead, we should have a get_markdown_between_headers(start_header: str, end_header: str = None) -> str
which will return all of the text between the given headers. If the end_header
is None
, just parse to the end of the file.
This will replace get_list_within_section
for gathering the ingredients and the directions.
First seen with pull request #5. The directions are have subheadings which cannot be parsed by the compiler.
When the compiler is run, the following exception is raised:
The parser should be changed to accept subheadings and display them correctly.