Fix to make util/closetag work with overlay modes. #820

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@nickjs
Contributor
nickjs commented Sep 11, 2012

In defined HTML overlay modes (like htmlmixed+liquid), the current closetag implementation will just bail out during the very specific mode check. If you change just the mode check to let it pass, it still won't be able to get to the nested modes.

This patch is my, admittedly, naive attempt to fix both of these issues. I am fully aware that there is probably a better way to go about this, and welcome any such feedback :)

@nickjs
Contributor
nickjs commented Sep 11, 2012

Of note, if your mode name doesn't include xml or htmlmixed at all, for example the mustache overlay demo, the regex still won't match. Is there a way to check the "parent mode" or some other similar mechanism?

@marijnh marijnh added a commit that referenced this pull request Sep 12, 2012
@marijnh marijnh Add new state introspection mechanism for nested modes
And move closetag over to it.

This makes the code that gets the XML state out of the mode actually
sound and extensible.

Issue #820
23c8c3e
@marijnh
Member
marijnh commented Sep 12, 2012

I've committed 23c8c3e instead, which, rather than adding another hack on a big stack of hacks, makes the process of getting the xml state out of a nested state actually well-defined and extensible.

@marijnh marijnh closed this Sep 12, 2012
@marijnh marijnh added a commit that referenced this pull request Sep 12, 2012
@marijnh marijnh Add new state introspection mechanism for nested modes
And move closetag over to it.

This makes the code that gets the XML state out of the mode actually
sound and extensible.

Issue #820
4cff3f1
@nickjs
Contributor
nickjs commented Sep 13, 2012

Hey Marijn, this is great. Thanks so much for putting it together so quickly!

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