Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Change Delimiters #29

Open
thegrandpoobah opened this Issue Dec 8, 2011 · 1 comment

Comments

Projects
None yet
2 participants

The spec says:

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

Yet the examples include things like:

{{= | | =}}

which to me seems to break the "non-whitespace sequence" rule. That is, the new tag delimiter should always immediatelly fllow the = character (or immediately precede it).

Am I misreading the little paragraph at the top?

Contributor

pvande commented Dec 8, 2011

It may be slightly ambiguous; whitespace is stripped off the beginning and end of the contents of every tag type. The delimiters in those examples should be defined wIthout that whitespace.

@estan estan added a commit to estan/qt-mustache that referenced this issue Aug 13, 2014

@estan estan Allow white space between '=' and delimiter.
Currently, qt-mustache will not allow any white space 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.".

Although the specification reads

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

apparently such white space should not be stripped, and e.g

    {{= [ ] =}}

should be allowed [2]. The spec is slightly ambiguos here, but
that is apprently the intention.

This patch changes `readSetDelimiter(..)` to skip across such
white space. 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.

[1] https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7
[2] mustache/spec#29
2054b9c

@estan estan added a commit to estan/qt-mustache that referenced this issue Aug 13, 2014

@estan estan Allow white space between '=' and delimiter.
Currently, qt-mustache will not allow any white space 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.".

Although the specification reads

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

apparently such white space should not be stripped, and e.g

    {{= [ ] =}}

should be allowed [2]. The spec is slightly ambiguos here, but
that is apprently the intention.

This patch changes `readSetDelimiter(..)` to skip across such
white space. 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.

[1] https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7
[2] mustache/spec#29
663388f

@estan estan added a commit to estan/qt-mustache that referenced this issue Aug 13, 2014

@estan estan 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

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

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

    {{= [ ] =}}

should be allowed [2]. 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.

[1] https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7
[2] mustache/spec#29
f319454

@estan estan added a commit to estan/qt-mustache that referenced this issue Aug 13, 2014

@estan estan 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

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

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

    {{= [ ] =}}

should be allowed [2]. 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.

[1] https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7
[2] mustache/spec#29
02b3b5a

@estan estan added a commit to estan/qt-mustache that referenced this issue Aug 14, 2014

@estan estan 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

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

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

    {{= [ ] =}}

should be allowed [2]. 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.

[1] https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7
[2] mustache/spec#29
ecfb14e

@estan estan referenced this issue in robertknight/qt-mustache Aug 14, 2014

Merged

Spec fixes #6

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