Skip to content

Commit

Permalink
beautify the 👻 tables
Browse files Browse the repository at this point in the history
  • Loading branch information
avigoldman committed Oct 26, 2017
1 parent 5fd24ff commit e2b91b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# HEML
<h1 align="center">&lt;heml&gt;</h1>


<p align="center">
<a href="https://heml.io/docs/getting-started/guide">Guide</a> &bull;
Expand Down
8 changes: 3 additions & 5 deletions packages/heml/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down

0 comments on commit e2b91b1

Please sign in to comment.