diff --git a/package-lock.json b/package-lock.json index 37f689b..cb0001d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "ejs": "^3.1.8", "express": "^4.17.1", "markdown-it": "^13.0.1", + "markdown-it-hashtag": "^0.4.0", "mkdirp": "^1.0.4", "showdown": "^2.1.0", "showdown-highlight": "^3.0.0" @@ -472,6 +473,11 @@ "markdown-it": "bin/markdown-it.js" } }, + "node_modules/markdown-it-hashtag": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/markdown-it-hashtag/-/markdown-it-hashtag-0.4.0.tgz", + "integrity": "sha512-+VCMH+f4/Ud5wPEtcAMrlLbUrrGViwR9JvjPy//X3Z7ZG1j5nQuHtDLTGZfMhkqYTMY+cTZgZkVNBsXMfU93Yg==" + }, "node_modules/mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", @@ -1145,6 +1151,11 @@ "uc.micro": "^1.0.5" } }, + "markdown-it-hashtag": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/markdown-it-hashtag/-/markdown-it-hashtag-0.4.0.tgz", + "integrity": "sha512-+VCMH+f4/Ud5wPEtcAMrlLbUrrGViwR9JvjPy//X3Z7ZG1j5nQuHtDLTGZfMhkqYTMY+cTZgZkVNBsXMfU93Yg==" + }, "mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", diff --git a/package.json b/package.json index e3ae6c5..77b3813 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "ejs": "^3.1.8", "express": "^4.17.1", "markdown-it": "^13.0.1", + "markdown-it-hashtag": "^0.4.0", "mkdirp": "^1.0.4", "showdown": "^2.1.0", "showdown-highlight": "^3.0.0" diff --git a/prestart.js b/prestart.js index abbd692..6ad7d89 100644 --- a/prestart.js +++ b/prestart.js @@ -78,7 +78,15 @@ function convertMarkdownInDirWithShowdown(inputDir, outputDir, converter) { } function convertRecipeMarkdown(inputDir, outputDir) { - var md = require('markdown-it')(); + var md = require('markdown-it')() + .use(require('markdown-it-hashtag')); + + md.renderer.rules.hashtag_open = function (tokens, idx) { + var tagName = tokens[idx].content.toLowerCase(); + return ''; + } + + md.renderer.rules.hashtag_close = function () { return ''; } // This is a hardcoded markdown header section number to html file name // diff --git a/recipes/chocolateChipCookies.md b/recipes/chocolateChipCookies.md index dd8f900..8b87024 100644 --- a/recipes/chocolateChipCookies.md +++ b/recipes/chocolateChipCookies.md @@ -1,5 +1,7 @@ # Chocolate Chip Cookies +#dessert #cookie + *yields: ~4 dozen*  diff --git a/views/pages/recipes/recipe_template.ejs b/views/pages/recipes/recipe_template.ejs index d69b30b..632cfc6 100644 --- a/views/pages/recipes/recipe_template.ejs +++ b/views/pages/recipes/recipe_template.ejs @@ -13,7 +13,7 @@