Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Partials have random indents in the middle of the line #128

Closed
kohenkatz opened this Issue · 3 comments

2 participants

@kohenkatz

I am using the following partial:

<div id="leftnav" data-url="{{#link_route}}entity_category_list_link{{/link_route}}"></div>

This partial is called in the following way:

...
        <div id="sidebar" class="left">
            {{>leftnav}}
        </div>
...

(Note: Github's viewer changes tabs to spaces in order to display them, but the line with the partial starts with three tabs and the lines on each side of it start with two.)

This generates the following output:

...
        <div id="sidebar" class="left">
            <div id="leftnav" data-url="            /category.json"></div>      </div>
...

When I look at what mustache is doing, I see that it is putting the indent from before the partial into the partial. However, it should not be doing that for every single mustache element inside the partial. For example, it breaks my link by having all those extra spaces in it.

I know that the easy way around this is just not to have the partial on a line by itself, but I think that this should be fixed.

@bobthecow
Owner

Thanks for reporting this.

Per the spec, mustache partials are to be re-indented to the level of the partial tag. It should only be doing it on line breaks though, so I'm not sure what's up with that. I'm in Nepal right now—just finished a trek to Everest base camp—so I can't check it out for a couple more days. Do you mind adding a failing test case and opening a pull request against the develop branch?

@kohenkatz

Sure, I'll try to write up a simple failing test case. I'll probably do it this coming Monday or Tuesday.

@bobthecow
Owner

I believe this has now been fixed in dev. Do you mind taking a look and verifying?

@bobthecow bobthecow closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.