Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Extra spaces in bread crumb after / #134

Open
bgantzler opened this issue Mar 6, 2018 · 0 comments
Open

Extra spaces in bread crumb after / #134

bgantzler opened this issue Mar 6, 2018 · 0 comments

Comments

@bgantzler
Copy link

I noticed when converting my current version of bread crumbs to this addon there was a extra space at the / for each bread crumb. Also noticed in your tests you trim before checking this.

If you would like to remove this extra space, change the breadcrumb.hbs to the following

{{#if route.linkable}}
  {{#link-to route.path class=linkClass}}
    {{~#if hasBlock}}
      {{yield this route}}
    {{else}}
      {{~route.title}}
    {{~/if}}
  {{/link-to}}
{{else}}
  {{~#if hasBlock}}
    {{yield this route}}
  {{else}}
    {{~route.title}}
  {{~/if}}
{{/if}}

You could move the tildes around or place more if I missed a senario

See http://handlebarsjs.com/expressions.html White Space Control
(I learned about this recently, don't know how I didn't know. Surprised it isn't used all the time)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant