cooklang / cooklang-obsidian

Edit and display CookLang recipes in Obsidian
MIT License
204 stars 16 forks source link

Cooking utensils and Ingredient names cut short with "special" characters #29

Open Yoekkul opened 1 year ago

Yoekkul commented 1 year ago

When inserting ingredients/cooking utensils with umlauts or accents they only get partially highlighted. Examples would look like the following: @ Möre #Schäler

Yoekkul commented 1 year ago

This could probably be fixed by adjusting the regex in cook.js For instance the regex used to detect ingredients could be replaced with

if(stream.match(/^@([^@#~]+?(?={))/))
          return "ingredient";
        else if(stream.match(/^@([\p{L}\p{M}]+?\b)+/u))
          return "ingredient";