robertknight/qt-mustache — pull request #6 by estan (2014-08-14 09:18:52+00:00)
Title: Spec fixes

Allow whitespace between '=' and delimiter.

Currently, qt-mustache will not allow any whitespace between the = signs and the start/end delimiter in set delimiter tags. It will treat such whitespace as being part of the delimiters and yield the error "Custom delimiters may not contain '=' or spaces.".

Apparently, even though [the specification reads](https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7)

"The tag's content MUST be any two non-whitespace sequences
(separated by whitespace) EXCEPT an equals sign ('=') followed
by the current closing delimiter.",

apparently such whitespace should ignored. E.g. tags such as

{{= [ ] =}}

[should be allowed](https://github.com/mustache/spec/issues/29). The spec is slightly ambiguos here I think, but that is apparently the intention.

This patch changes `readSetDelimiter(..)` to ignore such whitespace. As a result the "Pair with Padding" test case in `delimiters.json` now passes, since it has such a set delimiter tag. The "Sections" test case in the same file have one as well, and would also pass now if we only handled standalone tags properly.