diff --git a/index.js b/index.js index 15c6ef9..4132359 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ const fs = require('fs') const path = require('path') const Handlebars = require('handlebars') const micromark = require('micromark') +const striptags = require('striptags') const extname = '.hbs' const partialsDir = path.join(__dirname, 'partials') @@ -33,6 +34,8 @@ Handlebars.registerHelper('join', (arr, separator) => Handlebars.registerHelper('markdown', doc => micromark(doc)) +Handlebars.registerHelper('stripTags', html => striptags(html)) + exports.pdfRenderOptions = { mediaType: 'print' } exports.render = resume => { diff --git a/package-lock.json b/package-lock.json index 6e3a0ce..9ad64cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "license": "MIT", "dependencies": { "handlebars": "^4.7.6", - "micromark": "^2.11.4" + "micromark": "^2.11.4", + "striptags": "^3.1.1" }, "devDependencies": { "eslint": "7.20.0", @@ -4611,6 +4612,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/striptags": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/striptags/-/striptags-3.1.1.tgz", + "integrity": "sha1-yMPn/db7S7OjKjt1LltePjgJPr0=" + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -10981,6 +10987,11 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "striptags": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/striptags/-/striptags-3.1.1.tgz", + "integrity": "sha1-yMPn/db7S7OjKjt1LltePjgJPr0=" + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", diff --git a/package.json b/package.json index 68db500..6cf1072 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ }, "dependencies": { "handlebars": "^4.7.6", - "micromark": "^2.11.4" + "micromark": "^2.11.4", + "striptags": "^3.1.1" }, "devDependencies": { "eslint": "7.20.0", diff --git a/resume.hbs b/resume.hbs index 93239c3..1237cb8 100644 --- a/resume.hbs +++ b/resume.hbs @@ -3,7 +3,7 @@ {{resume.basics.name}} - +