From e2b91b14655a573e74edf67778a5676074e116f7 Mon Sep 17 00:00:00 2001 From: Avi Goldman Date: Wed, 25 Oct 2017 21:04:37 -0700 Subject: [PATCH] =?UTF-8?q?beautify=20the=20=F0=9F=91=BB=20tables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- packages/heml/src/index.js | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 09e06c8..583321d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# HEML +

<heml>

+

Guide • diff --git a/packages/heml/src/index.js b/packages/heml/src/index.js index fb0cd9c..a22354e 100644 --- a/packages/heml/src/index.js +++ b/packages/heml/src/index.js @@ -2,14 +2,12 @@ import parse from '@heml/parse' import render from '@heml/render' import inline from '@heml/inline' import validate from '@heml/validate' -import { utils } from '@heml/utils' +import { condition } from '@heml/utils' import byteLength from 'byte-length' import { html as beautify } from 'js-beautify' import { toArray, flattenDeep } from 'lodash' import * as coreElements from '@heml/elements' -const { condition } = utils - /** * renders the given HEML string with the config provided * @param {String} HEML the heml to render @@ -43,12 +41,12 @@ async function heml (contents, options = {}) { inline($html, options) /** beautify it 💅 */ - results.html = beautify(condition.replace($html.html()), { + results.html = condition.replace(beautify($html.html(), { indent_size: 2, indent_inner_html: true, preserve_newlines: false, extra_liners: [], - ...beautifyOptions }) + ...beautifyOptions })) /** final touches 👌 */ metadata.size = `${(byteLength(results.html) / 1024).toFixed(2)}kb`