Skip to content

Commit

Permalink
Tweak lookup of attributes to accommodate dash mangling by Interchange.
Browse files Browse the repository at this point in the history
  • Loading branch information
racke committed Feb 9, 2017
1 parent a0ceba9 commit e19840c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/WellWell/Compose.pm
Expand Up @@ -229,10 +229,17 @@ sub compose {

# TODO support multiple aliases
my ($name, $alias) = split(/=/, $comp, 2);
my ($name_lookup, $alias_lookup) = ($name, $alias);

# dash will be mangled by Interchange in
# [compose components.sidebar="sidebar-menu" attributes.sidebar-menu.topnav="..."]

$name_lookup =~ s/-/_/g;
$alias_lookup =~ s/-/_/g;

$component_attributes = {
$attributes{$name} ? %{$attributes{$name}} : (),
$attributes{$alias} ? %{$attributes{$alias}} : (),
$attributes{$name_lookup} ? %{$attributes{$name_lookup}} : (),
$attributes{$alias_lookup} ? %{$attributes{$alias_lookup}} : (),
};

# temporarily assign variables for component attributes
Expand Down

0 comments on commit e19840c

Please sign in to comment.