diff --git a/src/synthale/recipes.py b/src/synthale/recipes.py index b95604f..2de7b7a 100644 --- a/src/synthale/recipes.py +++ b/src/synthale/recipes.py @@ -66,8 +66,8 @@ class MarkdownRecipe: @property def style(self): """Return markdown for the recipe's style.""" - return '\n'.join(( - markdown.setext_heading('Style', 2), + heading = markdown.setext_heading('Style', 2) + '\n' + return heading + '\\\n'.join(( '{}: {}'.format(markdown.strong('Style guide'), self.recipe.style.style_guide), '{}: {}{}'.format(markdown.strong('Style category'), @@ -87,8 +87,9 @@ class MarkdownRecipe: boil_size = convert.liters(self.recipe.boil_size, '.1f') batch_size = convert.liters(self.recipe.batch_size, '.1f') - return '\n'.join(( - markdown.setext_heading('Details', 2), + heading = markdown.setext_heading('Details', 2) + '\n' + + return heading + '\\\n'.join(( '{}: {}'.format(markdown.strong('Type'), self.recipe.type), '{}: {:.1f} %'.format(markdown.strong('Batch efficiency'), self.recipe.efficiency), diff --git a/tests/test_recipes.py b/tests/test_recipes.py index 3d0c62f..098ac62 100644 --- a/tests/test_recipes.py +++ b/tests/test_recipes.py @@ -56,8 +56,8 @@ def test_markdown_recipe_style(): assert recipe.style == ( 'Style\n' '-----\n' - '**Style guide**: BJCP\n' - '**Style category**: 13E\n' + '**Style guide**: BJCP\\\n' + '**Style category**: 13E\\\n' '**Style name**: American Stout' ) @@ -68,15 +68,15 @@ def test_recipe_details(md_weizen): assert md_weizen.details == ( 'Details\n' '-------\n' - '**Type**: All Grain\n' - '**Batch efficiency**: 72.0 %\n' - '**Boil size**: 6.3 gal\n' - '**Boil length**: 60 min\n' - '**Batch size**: 5.5 gal\n' - '**Estimated OG**: 1.051\n' - '**Estimated FG**: 1.015\n' - '**Estimated IBU**: 15\n' - '**Estimated SRM**: 3.0\n' + '**Type**: All Grain\\\n' + '**Batch efficiency**: 72.0 %\\\n' + '**Boil size**: 6.3 gal\\\n' + '**Boil length**: 60 min\\\n' + '**Batch size**: 5.5 gal\\\n' + '**Estimated OG**: 1.051\\\n' + '**Estimated FG**: 1.015\\\n' + '**Estimated IBU**: 15\\\n' + '**Estimated SRM**: 3.0\\\n' '**Estimated ABV**: 4.7 %' )