We have RactiveJS templates that are creating in CKEditor, which outputs this
<p>Can you see it?</p>
<p>{{# visible }}</p>
<p>Now you see me</p>
<p>{{/ visible }}</p>
This used to work in Ractive v0.4, but gives a parse error in the latest version.
It seems like having a start and end tag of a section in a different HTML block no longer works.
Is there any way around this, without having to change the templates?
- Works in v0.4: https://jsfiddle.net/a243vsdx/1/
- Does not work in v0.8: https://jsfiddle.net/a243vsdx/
Updated to clarify the question:
- This was working in v0.4.x. What changed causing this to no longer function? Can you point out the line(s) in the source code?
- What alternative libraries could I use that do work parse mustache as expected and have two-way binding.
There's not really a way around this without changing the template. The parser has gotten a bit more strict over the last few versions because of confusing scenarios like this one, which doesn't result in the structure that it appears to. In this case, you get some extra, nested p tags, which isn't particularly harmful, but in other cases it is. So what you effectively have there in 0.4 is:
Ractive 0.8 (and I think 0.5+, but definitely 0.7+) follows along until the
</p>
after the open of the block, where it sees the closing tag for an element that isn't open and throws an error. Ractive has never supported blocks spanning tags because there's no way to represent that in the VDOM, which is a strict tree structure.