Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

The ability to replace multiple nodes in a single command #3

Open
zostay opened this Issue · 1 comment

2 participants

@zostay

I love this module, but I'm having a problem if I try to use it in a certain way. Here's a program to demonstrate:

use 5.12.1;
use Template::Semantic;
say Template::Semantic->process(\*DATA, {
    '.navigation' => [ { 'a' => 'Link 1' }, { 'a' => 'Link 2' } ],
});
__DATA__
<body>
    <ul id="topnav">
        <li class="navigation"><a href="...">Top Nav</a></li>
    </ul>
    <div id="content">...</div>
    <ul id="bottomnav">
        <li class="navigation"><a href="...">Bottom Nav</a></li>
    </ul>
</body>

The output is:

<body>
    <ul id="topnav">
        <li class="navigation"><a href="...">Link 1</a></li>
        <li class="navigation"><a href="...">Link 2</a></li>
    </ul>
    <div id="content">...</div>
    <ul id="bottomnav">
        <li class="navigation"><a href="...">Bottom Nav</a></li>
        <li class="navigation"><a href="...">Bottom Nav</a></li>
    </ul>
</body>

Ideally, I would expect that the second navigation would look like the first. In the meantime, the fix is to use two rules, "#topnav .navigation" and "#bottomnav .navigation" with the same array to fill them in.

Cheers.

@tomill
Owner

Thank you report, I will try to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.