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

Adds support for EJS shared blocks #242 #387

Merged
merged 6 commits into from May 13, 2013

Conversation

Projects
None yet
1 participant
@andykant
Contributor

andykant commented May 13, 2013

Transforms the EJS template to add support for shared blocks. Essentially, this breaks up EJS tags into multiple EJS tags if they contained unmatched brackets.

These types of templates previously worked prior to adding live binding support to EJS. It also isn't obvious that they shouldn't work and can cause issues if you don't know about this quirk.

For example, this doesn't work:

<% if (1) { %>
  <% if (1) { %>
    hi
  <% } 
} %>

...without isolated EJS blocks:

<% if (1) { %>
  <% if (1) { %>
    hi 
  <% } %>
<% } %> 

The result of transforming:

<% if (1) { %><% %>
  <% if (1) { %><% %>
    hi
  <% %><% } %>
<% } %> 

andykant added some commits May 10, 2013

Added support for EJS shared blocks #242
Transforms the EJS template to add support for shared blocks.
Essentially, this breaks up EJS tags into multiple EJS tags if they
contained unmatched brackets.

For example, this doesn't work:
	<% if (1) { %><% if (1) { %> hi <% } } %>
...without isolated EJS blocks:
	<% if (1) { %><% if (1) { %> hi <% } %><% } %>
The result of transforming:
	<% if (1) { %><% %><% if (1) { %><% %> hi <% } %><% } %>
@andykant

This comment has been minimized.

Show comment
Hide comment
@andykant

andykant May 13, 2013

Contributor

Please review these changes before we merge this @justinbmeyer @ccummings @daffl

Do you foresee any issues with these changes?

Contributor

andykant commented May 13, 2013

Please review these changes before we merge this @justinbmeyer @ccummings @daffl

Do you foresee any issues with these changes?

@andykant

This comment has been minimized.

Show comment
Hide comment
@andykant

andykant May 13, 2013

Contributor

This commit should be included in the final build for JMVC 3.3.

Contributor

andykant commented May 13, 2013

This commit should be included in the final build for JMVC 3.3.

andykant added some commits May 13, 2013

Eliminated the empty generated EJS tags, added more shared block tests
…#242

For some reason a template loaded by file generates a different result
than one loaded by string.
@andykant

This comment has been minimized.

Show comment
Hide comment
@andykant

andykant May 13, 2013

Contributor

This now fixes the issues that I was having (non-isolated blocks of code breaking), but still doesn't fix the original issue for #242 (losing variables).

Contributor

andykant commented May 13, 2013

This now fixes the issues that I was having (non-isolated blocks of code breaking), but still doesn't fix the original issue for #242 (losing variables).

andykant added a commit that referenced this pull request May 13, 2013

Merge pull request #387 from bitovi/issue-242
Adds support for EJS shared blocks #242

@andykant andykant merged commit a886c60 into master May 13, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment