Skip to content

EEx multiple callbacks with -> %>…<% end format #8590

@LostKobrakai

Description

@LostKobrakai

Environment

  • Elixir & Erlang/OTP versions (elixir --version): 1.7.3 / 21
  • Operating system: MacOS X

Current behavior

<%= component(ComponentsWeb.GridListView, [list: ["a", "b"]], fn assigns -> %>
  <div style="display: inline-block">
    <h1><%= @item %></h1>
  </div>
<% end, fn assigns -> %>
  <div style="display: inline-block">
    <h1><%= @item %></h1>
  </div>
<% end) %>

Having this in an eex template I get an syntax error: ** (SyntaxError) lib/components_web/templates/page/index.html.eex:5: unexpected token: end

Expected behavior

I'm not sure if this is purposefully not possible, but having the possiblity to define multiple -> %>…<% end callbacks for a single function call would enable the possibiltiy to build components with multiple slots to be filled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions