diff --git a/lib/render-example.js b/lib/render-example.js
index d80a09db54..430e659f79 100644
--- a/lib/render-example.js
+++ b/lib/render-example.js
@@ -1,6 +1,7 @@
import frontMatter from 'front-matter';
import fs from 'fs';
import nunjucks from 'nunjucks';
+import { minify } from 'html-minifier';
export default function renderExample(templatePath, nunjucksEnvironment) {
try {
@@ -24,11 +25,22 @@ export default function renderExample(templatePath, nunjucksEnvironment) {
}
const compiledTemplate = nunjucks.compile(template, nunjucksEnvironment, templatePath);
-
let html = compiledTemplate.render(templatePath);
+ html = minify(html, {
+ removeComments: true,
+ collapseWhitespace: true,
+ });
+ //console.log(html);
+ return html;
+
+ // let html = compiledTemplate.render(templatePath);
+ // html = minify(html, {
+ // removeComments: true,
+ // collapseWhitespace: true,
+ // });
- //removes whitespace and linebreaks before svg tags.
- return html.replace(/\s*(
- {% elif params.iconType == "arrow-next" %}
-