question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`docs-demo` fails to compile template with certain actions on elements

See original GitHub issue

I’m trying to re-write my documentation for ember-steps using this addon and am running into trouble with the docs-demo component. For example, this snippet fails to compile in a Markdown file, despite being valid Handlebars

{{#docs-demo as |demo|}}
  {{#demo.example name='cookbook-tabs.hbs'}}
    {{#step-manager as |w|}}
      <button {{action w.transition-to 'first'}}>
        First Tab
      </button>
      <button>
        Second Tab
      </button>

      <hr>

      {{#w.step name='first'}}
        This content is on the first tab
      {{/w.step}}

      {{#w.step name='second'}}
        This content is on the second tab
      {{/w.step}}
    {{/step-manager}}
  {{/demo.example}}

  {{demo.snippet 'cookbook-tabs.hbs'}}
{{/docs-demo}}

It chokes on this part:

<button {{action w.transition-to 'first'}}>
  First
</button>

with the following error:

Closing tag button (on line 7) without an open tag.

Some different variations of the {{action}} also fail, such as this:

<button {{action w.transition-to 'first'}}>
  First
</button>

This one passes compilation, but doesn’t actually do what I want it to

<button {{action w.transition-to}}>
  First
</button>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
samselikoffcommented, Aug 20, 2018

think we should go with #2 for now, especially for docs-demo.

0reactions
dfreemancommented, Aug 20, 2018

Three approaches that come to mind:

  1. Investigate other markdown parsers to see if any others place more nicely with our needs
  2. Advise people to move their hbs into dedicated local components if it reaches the point of complexity that this issue pops up
  3. Preprocess the markdown files before handing them to marked, then do the same thing backwards afterwards e.g.
    # Heading
    {{#some-component as |sc|}}
      <p {{action sc.foo}}>Hello</p>
    {{/some-component}}
    
    # Heading
    <hbs-placeholder-1>
      <p hbs-placeholder-2>Hello</p>
    </hbs-placeholder-1>
    
Read more comments on GitHub >

github_iconTop Results From Across the Web

akhet/content.rst at master - demo - GitHub
akhet/docs/demo/content.rst ... This is a page template, so it contains only the unique parts of this page. The first three lines are Mako...
Read more >
pdoc API documentation
This will create an HTML file at docs/demo.html which contains our module ... In the GitHub Pages settings, select GitHub Actions as your...
Read more >
AngularJS template function in directive giving error 'Template ...
I am working on an angular application. for a certain directive, I use the template function like this: template: function(element, attr) ...
Read more >
CLI Examples - BaseSpace Developers - Illumina
Relist all datasets. Using custom columns selected from the headers list: $ bs list datasets -F Name -F QcStatus -F TotalSize -F AppSession....
Read more >
Oracle Utilities Application Framework Software Development ...
Oracle Corporation and its affiliates will not be responsible for any ... Components of the Software Development Kit ... Test default actions on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found