Last active
August 20, 2017 15:45
-
-
Save scmorrison/a771af17acf432331f6e0adba9bff945 to your computer and use it in GitHub Desktop.
Perl 6 - Template::Mustache nested hash rendered ordering incorrect
This file contains 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
#!/usr/bin/env perl6 | |
use v6; | |
use Template::Mustache; | |
my %h = categories => [ | |
category_pages => [{ | |
title => "Perl 6", | |
url => "https://www.perl6.org"}, { | |
title => "Perl 6 Modules", | |
url => "https://modules.perl6.org"}], | |
title => "General tasks"]; | |
my $html = q:to/EOF/; | |
{{#categories}} | |
{{ title }} <!-- should be first item --> | |
{{#category_pages}} | |
{{ title }} : {{ url }}</br> | |
{{/category_pages}} | |
{{/categories}} | |
EOF | |
say Template::Mustache.render: $html, %h; | |
# Output | |
# | |
# <!-- should be first item --> | |
# Perl 6 : https://www.perl6.org</br> | |
# Perl 6 Modules : https://modules.perl6.org</br> | |
# General tasks <!-- should be first item --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment