diff --git a/html.js b/html/index.js similarity index 100% rename from html.js rename to html/index.js diff --git a/html/raw.js b/html/raw.js new file mode 100644 index 0000000..975455c --- /dev/null +++ b/html/raw.js @@ -0,0 +1 @@ +module.exports = require('bel/raw') diff --git a/package.json b/package.json index 203fb1b..32fea26 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,14 @@ "main": "index.js", "files": [ "index.js", - "html.js", + "html/index.js", + "html/raw.js", "dist", "example" ], "scripts": { "build": "mkdir -p dist/ && browserify index -p bundle-collapser/plugin > dist/bundle.js && browserify index -g unassertify -g uglifyify -p bundle-collapser/plugin | uglifyjs --mangle-props -c unsafe,properties,dead_code,comparisons,evaluate,hoist_funs,if_return,join_vars,pure_getters,reduce_vars,collapse_vars --toplevel > dist/bundle.min.js && cat dist/bundle.min.js | gzip --best --stdout | wc -c | pretty-bytes", - "deps": "dependency-check --entry ./html.js . && dependency-check . --extra --no-dev --entry ./html.js", + "deps": "dependency-check --entry ./html/index.js . && dependency-check . --extra --no-dev --entry ./html/index.js", "inspect": "browserify --full-paths index -g unassertify -g uglifyify | discify --open", "prepublish": "npm run build", "start": "bankai start example", diff --git a/test.js b/test.js index e16f5b0..e3b85f3 100644 --- a/test.js +++ b/test.js @@ -1,17 +1,19 @@ var tape = require('tape') var html = require('./html') +var raw = require('./html/raw') var choo = require('./') tape('should render on the server', function (t) { var app = choo() app.route('/', function (state, emit) { + var strong = 'Hello filthy planet' return html` -
Hello filthy planet
+${raw(strong)}
` }) var res = app.toString('/') - var exp = 'Hello filthy planet
' + var exp = 'Hello filthy planet
' t.equal(res.toString().trim(), exp, 'result was OK') t.end() })