seethroughdev / obsidian-recipe-grabber

MIT License
59 stars 8 forks source link

Failure to parse instructions with headers #11

Closed illusionistpm closed 11 months ago

illusionistpm commented 1 year ago

The parser fails when groups of instructions are separate by headers. For example: https://simplyhomecooked.com/air-fryer-chicken-tenders/#recipe https://www.triedandtruerecipe.com/creamy-broccoli-pasta/

seethroughdev commented 12 months ago

thanks for posting this. so sorry for the late reply.

hopefully have a fix shortly. keep you updated.

seethroughdev commented 11 months ago

Okay, so confirmed the issues is some schemas have nested levels of instructions, that wrap with "@type": "HowToSection",

 "recipeInstructions": [
        {
          "@type": "HowToSection",
          "name": "Cook the pasta:",
          "itemListElement": [
            {
              "@type": "HowToStep",
              "text": "Bring a large pot of salted water to a boil. Cook the pasta until al dente. Reserve ¼ cup of the pasta cooking water and set aside. Drain and set aside.",
              "name": "Bring a large pot of salted water to a boil. Cook the pasta until al dente. Reserve ¼ cup of the pasta cooking water and set aside. Drain and set aside.",
              "url": "https://www.triedandtruerecipe.com/creamy-broccoli-pasta/#wprm-recipe-19480-step-0-0"
            }
          ]
        },

I'll have a fix in the next release.

seethroughdev commented 11 months ago

Fixed in 0.16.0. Thanks again for posting this.