Last active
December 12, 2015 04:28
-
-
Save pyykkis/4714420 to your computer and use it in GitHub Desktop.
Function construction rules for Transparency directives.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template = $(""" | |
<div> | |
<div class="name"></div> | |
<a class="url"></a> | |
</div> | |
""") | |
data = | |
name: 'Foo Bar' | |
url: 'linkedin.com/foo.bar' | |
directives = | |
url: href: '.url.trim' | |
template.render data, directives | |
expected = $(""" | |
<div> | |
<div class="name">Foo Bar</div> | |
<a class="url" href="linkedin.com/foo.bar">linkedin.com/foo.bar</a> | |
</div> | |
""") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment