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

styleModifier and message tag conflicting #184

Closed
theorise opened this issue Nov 13, 2015 · 5 comments
Closed

styleModifier and message tag conflicting #184

theorise opened this issue Nov 13, 2015 · 5 comments

Comments

@theorise
Copy link

I am having troubles combining both {{styleModifier}} and {{message}} when calling the same pattern multiple times. It seems to just find the first {{styleModifier}} and repeat it only when {{message}} is also being used.


Atom:

<span class="test-class_base {{styleModifier}}">
    [test][{{message}}]
</span>

{{styleModifier}} works when I call the following:

<div class="test-group">
    {{> atoms-test:testclass1 }}
    {{> atoms-test:testclass2 }}
    {{> atoms-test:testclass3 }}
    {{> atoms-test:testclass4 }}
</div>

Output:

<div class="test-group">
    <span class="test-class_base testclass1">
        [test][]
    </span>
    <span class="test-class_base testclass2">
        [test][]
    </span>

    <span class="test-class_base testclass3">
        [test][]
    </span>

    <span class="test-class_base testclass4">
        [test][]
    </span>
</div>

{{message}} works when I call the following:

<div class="test-group">
    {{> atoms-test(message: "{{test.one}}" ) }}
    {{> atoms-test(message: "{{test.two}}" ) }}
    {{> atoms-test(message: "{{test.three}}" ) }}
    {{> atoms-test(message: "test-4" ) }}
</div>

Output:

<div class="test-group">
    <span class="test-class_base ">
        [test][test-1]
    </span>

    <span class="test-class_base ">
        [test][test-2]
    </span>

    <span class="test-class_base ">
        [test][test-3]
    </span>

    <span class="test-class_base ">
        [test][test-4]
    </span>
</div>

{{message}} works but {{styleModifier}} does not (it repeats the first instance) when I call the following:

<div class="test-group">
    {{> atoms-test:testclass1(message: "{{test.one}}" ) }}
    {{> atoms-test:testclass2(message: "{{test.two}}" ) }}
    {{> atoms-test:testclass3(message: "{{test.three}}" ) }}
    {{> atoms-test:testclass4(message: "test-4" ) }}
</div>

Output:

<div class="test-group">
    <span class="test-class_base testclass1">
        [test][test-1]
    </span>

    <span class="test-class_base testclass1">
        [test][test-2]
    </span>

    <span class="test-class_base testclass1">
        [test][test-3]
    </span>

    <span class="test-class_base testclass1">
        [test][test-4]
    </span>
</div>
@bmuenzenmeyer
Copy link
Member

Thanks for the thorough test cases. A quick glance makes me think some of this syntax (like having mustache inside the pattern parameter itself) was not considered or supported. Do you know if all of this works in PL PHP? I try to emulate that wherever possible but would be lying if I said I had parity in every feature yet.

This should be something to confirm with a unit test. I'll check that out if no one else gets to it.

@theorise
Copy link
Author

I am unsure if this is working with PHP PL, I did a brief search and I found no similar issues.

@bmuenzenmeyer
Copy link
Member

No problem. I'll try to look into all of this soon-ish.... probably next
week.

On Fri, Nov 13, 2015 at 8:37 AM theorise [email protected] wrote:

I am unsure if this is working with PHP PL, I did a brief search and I
found no similar issues.


Reply to this email directly or view it on GitHub
#184 (comment)
.

@bmuenzenmeyer
Copy link
Member

Using the similar test harness of #190 I get this:

image

even putting in the partials as values like so:

{{> atoms-avatar:foo1(message: "{{name.first}}") }}
{{> atoms-avatar:foo2(message: "{{name.middle}}") }}
{{> atoms-avatar:foo3(message: "{{name.last}}") }}
{{> atoms-avatar:foo4(message: "4") }}

yields:

image

Therefore, this is a duplicate of #190 and should be resolved with same fix near as I can tell.

@bmuenzenmeyer
Copy link
Member

@theorise please upgrade to v0.15.1 and try your test cases again!

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

No branches or pull requests

2 participants