Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference implementation (feature v1.2.0) #14

Closed
3 tasks done
soranoba opened this issue Aug 21, 2016 · 1 comment
Closed
3 tasks done

Reference implementation (feature v1.2.0) #14

soranoba opened this issue Aug 21, 2016 · 1 comment

Comments

@soranoba
Copy link
Owner

soranoba commented Aug 21, 2016

Overview

Additional functions

✅ Support the dotted names. (child's variables)

data:
    {"parent.child" : "before", "parent": {"child" : "after"}}
template:
    {{parent.child}}
v1.1.x result:
    before
v1.2.x result:
    after

💡 Dot in the tag become the meaning as a separator.

✅ Support the recursive partials.

💡 It had become an infinite loop in v1.1.x.

✅ Support the indent in partials.

data: 
    {"sections" : [ {"section" : "1st section"}, {"section" : "2nd section"}]}
template:
    {{>a}}
a.mustache
    {{# sections }}
    {{ section }}
        {{>b}}
    {{/ sections }}
b.mustache
    {{ section }}
        {{>c}}
c.mustache
    Hello, indent paritals !
    2nd line
    3rd line
result:
    1st section
        1st section
            Hello, indent paritals !
            2nd line
            3rd line
    2nd section
        2nd section
            Hello, indent paritals !
            2nd line
            3rd line

Modified function

✅ Change the escape characters. #13

💡 Escape characters is & " > <

✅ Reset the delimiters in the partial sections.

💡 It did not reset the delimiters in v1.1.x.

✅ If the tag including the space has been specified, it became to delete the space.

data: 
     {"keep space" : "keep_space_tag", "deletespace" : "delete_space_tag"}
template:
     {{ keep space }}{{ delete space }}
v1.1.x result:
     keep_space_tag
v1.2.x result:
     delete_space_tag

💡 Tag MUST NOT include the spaces. The current behavior is likely to change in the future.

✅ Change of the processing of the new line.

Except for the Variables (that is, {{key}} or {{{key}}}, {{&key}}),
this line is not included in the output, when there is only a tag on the line.

Minor update (with backward compatibility)

  • Support the proplist that include empty tuple : [{}]
  • Change of internal state.
  • update the doc.

NOTE

This time, those that saw off the implementation.

@soranoba
Copy link
Owner Author

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

No branches or pull requests

1 participant