Skip to content

Conversation

@nfour
Copy link

@nfour nfour commented Jul 26, 2014

Fixes #79. I'm not 100% sure that this doesn't break anything but from my tests it seems to be fine. Would be great if someone who knows ECT could make this more elegant.

Basically makes this work as you would expect:

base.ect

<< block 'image' : >>
  <img src="111.png" />
<< end >>
<< include 'imageBox' >>
<< block 'image' : >>
  <img src="222.png" />
<< end >>
<< include 'imageBox' >>

imageBox.ect

<div class="imageBox">
  << content 'image' >>
</div>

The above example previously would compile both << include 'imageBox' >> to only the first block content ( `111.png ).

I'd imagine something like this could be used to make #50 work as well without too much pain.

@paulyoung
Copy link

This appears to fix #83 but without a test suite it's impossible to know the impact of these changes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter part of this conditional statement becomes unreachable with this change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That to say, since this always returns true then it should likely not return anything and any code relying on it be refactored.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that so that the previous statement would still exist there and goad someone who knows why it's there to change it. It could merely be commented out though.

@paulyoung
Copy link

@baryshev could you take a look at this please?

@nfour
Copy link
Author

nfour commented Aug 21, 2014

Been using this in production for a few weeks now and I'm not seeing any problems, but, a test suite would be pretty nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blocks cant be redefined!

2 participants