+4
-0
@@ -0,1 +1,5 @@ | ||
| ## Version 1.1.0 - January 29, 2015 | ||
| * Support subexpressions (thanks @raycohen for the pull request!) | ||
| ## Version 1.0.2 - January 22, 2015 | ||
@@ -2,0 +6,0 @@ |
@@ -19,4 +19,11 @@ fs = require("fs") | ||
| when "INTEGER" then value.integer | ||
| when undefined then handlebarsStringForSubexpression(value) | ||
| else throw new Error("Unsupported value type: #{value.type}") | ||
| handlebarsStringForSubexpression = (value) -> | ||
| throw new Error("Subexpression with no id: #{value}") unless value.id?.original | ||
| arr = ["(", value.id.original, paramsToString(value.params), pairsToAttrString(value.hash?.pairs), ")"] | ||
| arr.push processStatements(value.program.statements) if value.program? | ||
| _(arr).flatten().join('') | ||
| pairsToAttrString = (pairs) -> | ||
@@ -23,0 +30,0 @@ return '' unless pairs? && pairs.length > 0 |
+1
-1
| { | ||
| "name": "emblem2hbs", | ||
| "description": "Convert emblem templates to Handlebars", | ||
| "version": "1.0.2", | ||
| "version": "1.1.0", | ||
| "homepage": "http://www.emblemjs.com/", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -108,2 +108,5 @@ <div {{bind-attr class=":thingy :has-drag-handle view.domId"}}> | ||
| <div class="columns large-3 medium-5"> | ||
| {{#link-to "some-route" (query-params page=pageNumber)}} | ||
| Link text | ||
| {{/link-to}} | ||
| <ul role="toolbar" class="thingy-editor-tabs"> | ||
@@ -110,0 +113,0 @@ <li> |
@@ -20,2 +20,3 @@ chai = require("chai") | ||
| ['App.MyTextArea objectBinding="view.answer" hideFieldName=true rows=20 cols=40', '{{view App.MyTextArea objectBinding="view.answer" hideFieldName=true rows=20 cols=40}}'] | ||
| ['p {{echofun true (hello how="are" you=false) 1 not=true fun=(equal "ECHO hello" (echo (hello))) win="yes"}}', '<p>{{echofun true (hello how="are" you=false) 1 not=true fun=(equal "ECHO hello" (echo (hello))) win="yes"}}</p>'] | ||
| ] | ||
@@ -34,2 +35,10 @@ | ||
| it 'should work with subexpressions like query-params', -> | ||
| emblem = """ | ||
| = link-to "some-route" (query-params page=pageNumber) | ||
| | Link text | ||
| """ | ||
| hbs = "{{#link-to \"some-route\" (query-params page=pageNumber)}}Link text{{/link-to}}" | ||
| assert.equal(Processor.process(emblem), hbs) | ||
| it 'should turn some Emblem with Handlebars tags into Handlebars', -> | ||
@@ -36,0 +45,0 @@ emblem = """ |
Sorry, the diff of this file is not supported yet
21506
6.17%