Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mustache nested in text does not work with pipe #222

Open
ryanlntn opened this issue Mar 20, 2015 · 3 comments
Open

Mustache nested in text does not work with pipe #222

ryanlntn opened this issue Mar 20, 2015 · 3 comments
Labels
Milestone

Comments

@ryanlntn
Copy link

I'm getting the following errors after trying to upgrade to 0.5.0:

Parse error on line 1:
...{{link-to 'contact' | Contact}} support.
-----------------------^
Expecting 'CLOSE', 'CLOSE_UNESCAPED', 'STRING', 'INTEGER', 'BOOLEAN', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'DATA', got 'INVALID'
Error: Parse error on line 1:
...{{link-to 'contact' | Contact}} support.
-----------------------^
Expecting 'CLOSE', 'CLOSE_UNESCAPED', 'STRING', 'INTEGER', 'BOOLEAN', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'DATA', got 'INVALID'

The emblem template code in question:

#{link-to 'contact' | Contact} support.

I tried removing all the pipes and now I'm seeing:

Error while processing route: index 
Unknown template object: function Error
  at http://localhost:3000/assets/frontend/vendor-b7a9ee40048d47a4bc4e9411d7a7dd9a.js?body=1:10644:25
  at http://localhost:3000/assets/frontend/vendor-b7a9ee40048d47a4bc4e9411d7a7dd9a.js?body=1:10648:3
  at __module4__.string (http://localhost:3000/assets/frontend/vendor-b7a9ee40048d47a4bc4e9411d7a7dd9a.js?body=1:10502:42)
  at http://localhost:3000/assets/frontend/vendor-b7a9ee40048d47a4bc4e9411d7a7dd9a.js?body=1:10504:2

  logError                    @ ember.js:26275
  defaultActionHandlers.error @ ember.js:26232 
  triggerEvent                @ ember.js:26323
  trigger                     @ ember.js:47549
  Transition.trigger          @ ember.js:47394
  finalizeTransition          @ ember.js:46582
  (anonymous function)        @ ember.js:45984
  tryCatch                    @ ember.js:47983
  invokeCallback              @ ember.js:47995
  publish                     @ ember.js:47966
  (anonymous function)        @ ember.js:29463
  Queue.invoke                @ ember.js:849
  Queue.flush                 @ ember.js:914
  DeferredActionQueues.flush  @ ember.js:719
  Backburner.end              @ ember.js:144
  Backburner.run              @ ember.js:199
  run                         @ ember.js:17906
  ember$data$lib$system$adapter$$Adapter.extend.ajax.Ember.RSVP.Promise.hash.success @ rest_adapter.js:892
  jQuery.Callbacks.fire                  @ jquery.js:3144
  jQuery.Callbacks.self.fireWith         @ jquery.js:3256
  done                                   @ jquery.js:9310
  jQuery.ajaxTransport.send.callback     @ jquery.js:9714

I'm not sure what I'm doing wrong here. The plaintext example on http://emblemjs.com/syntax/ seems to indicate my template is correct and it was working before I switched over.

@ryanlntn
Copy link
Author

I just tried adding the following test:

test('link-to test', function(){
  compilesTo("| #{link-to 'aroute' | Some Text}", "{{link-to 'aroute'}}Some Text{{/link-to}}");
});

and got:

229) text: pipe character: link-to test

     compilesTo assertion failed:
    Emblem:   "| #{link-to 'aroute' | Some Text}"
    Expected: "{{link-to 'aroute'}}Some Text{{/link-to}}"
    Actual:   "{{link-to 'aroute' | Some Text}}"

Is this expected behavior? How are people handling inline links?

@mixonic
Copy link
Collaborator

mixonic commented Mar 22, 2015

@ryanlntn this looks like a regression, there was no test for this syntax :-(

@bantic
Copy link
Collaborator

bantic commented Mar 22, 2015

@ryanlntn If you run into other problems you can live-preview emblem compilation here: http://bantic.github.io/try-emblem/. And yes, this does look like a regression. Thanks for reporting it.

@bantic bantic added this to the 0.5.1 milestone Mar 22, 2015
@bantic bantic added the bug label Mar 22, 2015
@thec0keman thec0keman changed the title Parse error after upgrading to 0.5.0 Mustache nested in text does not work with pipe Dec 19, 2018
@thec0keman thec0keman modified the milestones: 0.6.0, v1.0.0 Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants