質問

In my template files for my Yeoman generator I have if statements to decide whether or not to include some content in the generated files. When the if condition is not satisfied I end up with character returns where the if statement was in the files produced from the template. Is there any way to eliminate these?

役に立ちましたか?

解決

It is down to the placement of the if statements this is the way to use them for a list.

<ul>
    <li>HTML5 Boilerplate</li><% if (includeJeet) { %>
    <li>Jeet</li><% } %><% if (includeRespond) { %>
    <li>Respond</li><% } %>
</ul>

If the if statement commences on a new line then the new line is created.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top