You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this PR, @jimbobbennett submitted a recipe which included the instruction:
1. Whilst the condensed milk is boiling, make the pie base:
1. Grease a pie dish with butter
1. Put the digestive biscuits in a plastic bag and smash and roll with a rolling pin till you have fine crumbs
1. Melt a small amount of butter in a pan and mix in the biscuit crumbs. You need enough butter for the crumbs to stick together, but not too much, so keep adding small bits of butter as needed until the crumbs start to bind.
1. Spread the crumbs into the pie dish and press them firmly to the bottom and sides to make a pie base
1. Put in the fridge till the butter cools and sets
The compiler did not render the indented instructions:
Root cause
The get_list_within_section function does not recursively collect items. It only checks the first set of children within a list and returns the strings. Source
Possible solutions
Instead of returning a list of strings, the parser should return a list of nodes which may be leafs or have children. No new class should be needed, the existing Node class in the marko package will do the job just fine.
The Recipe class will need to be changed such that the ingredients and instructions attributes are lists of Node instead of str.
The render_recipe_page will need to be changed to render HTML from the markdown nodes before being passed to the Jinja template.
The text was updated successfully, but these errors were encountered:
Issue
When a user writes a list of ingredients or directions with a sublist, the sublist is not parsed in and is omitted in the output.
This issue was first seen in @jimbobbennett's pull request #3.
In this PR, @jimbobbennett submitted a recipe which included the instruction:
The compiler did not render the indented instructions:
Root cause
The
get_list_within_section
function does not recursively collect items. It only checks the first set of children within a list and returns the strings. SourcePossible solutions
Instead of returning a list of strings, the parser should return a list of nodes which may be leafs or have children. No new class should be needed, the existing
Node
class in themarko
package will do the job just fine.The
Recipe
class will need to be changed such that theingredients
andinstructions
attributes are lists ofNode
instead ofstr
.The
render_recipe_page
will need to be changed to render HTML from the markdown nodes before being passed to the Jinja template.The text was updated successfully, but these errors were encountered: