lachholden / obsidian-recipe-view

View your Obsidian notes as interactive recipe cards while you cook.
https://obsidian-recipe-view.readthedocs.io/en/latest/
MIT License
103 stars 4 forks source link

Is manual control for scaling ingredients broken? #17

Closed skepickle closed 11 months ago

skepickle commented 11 months ago

Obsidian: v1.4.16 Recipe view: 0.3.5

In a non-ingredients section, I am trying to use the syntax in the documentation to make it so that "Scale recipe" will alter the numbers in the directions.

<span data-qty-parse>180 grams</span>

When I scale the recipe, the '180 grams', remains unchanged even though the ingredient section's amounts scale correctly. Am I doing something wrong here?

lachholden commented 11 months ago

Could you please upload the whole .md file? It shouldn't be broken.

skepickle commented 11 months ago

Here's a simple one for toast (teehee) with an optional step:

## Ingredients
- 1 slice of white bread
- 0.5 tsp. unsalted butter

## Directions

#### Basic steps
- Toast bread in toaster.
- Spread butter onto toast.

#### Optional Steps
Combine all ingredients in a medium bowl. Test <span data-qty-parse>180 grams</span>.

## Nutrition
Will give you fae-heart-attacks.

When I scale this, only the values in the Ingredients section will scale... the 180 grams remains static.

skepickle commented 11 months ago

btw, I love this plugin. It's super useful!

skepickle commented 11 months ago

I will say this, if I don't put the instructions under the "####" header, it scales fine... weird huh?

lachholden commented 11 months ago

I've figured it out :) You've got a nonbreaking space between the <span and the data-qty-parse>, which breaks the HTML parsing. Just delete that and replace it with a regular space and you're golden :)

Eonflare14 commented 4 months ago

just to let you know the non breaking space seems to still be in the docs at https://obsidian-recipe-view.readthedocs.io/en/latest/usage/scaling.html