From 977cbe0f1cddafbbf0338a6446f95a08ff2e29da Mon Sep 17 00:00:00 2001 From: Jake Boone Date: Thu, 31 Mar 2022 13:38:04 -0700 Subject: [PATCH] Add `allowLeadingOf` option to demo --- demo/index.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/demo/index.html b/demo/index.html index ead2085..62cd102 100644 --- a/demo/index.html +++ b/demo/index.html @@ -130,7 +130,7 @@

Ingredient List

2 cups all-purpose flour (spooned and leveled), plus more for pans 2 teaspoons baking soda 1/2 teaspoon baking powder -2 teaspoons ground cinnamon +2 teaspoons of ground cinnamon 1/2 teaspoon ground ginger 3⁄4 teaspoon salt 2 cups packed light-brown sugar @@ -138,11 +138,17 @@

Ingredient List

4 Granny Smith apples, peeled, two coarsely grated and two diced
- +
+ +
+

Results

 (Click "Parse" to see results.)
Results .getElementById('parse') .addEventListener('click', function(event) { var normalizeUOM = document.getElementById('normalize-uom').checked; + var allowLeadingOf = document.getElementById('allow-leading-of').checked; document.getElementById('results').innerHTML = JSON.stringify( ParseIngredient.parseIngredient(document.getElementById('ingredient-list').value, { normalizeUOM: normalizeUOM, + allowLeadingOf: allowLeadingOf, }), null, 2