1. Michael Bayer
  2. mako
  3. Issues

Issues

Issue #108 resolved

<%namespace:defname> converts the method name to lowercase

guest
created an issue

This raises a problem when the defname contains uppercase letters as the closing tag won't match the opening tag meaning you have to fall back to using call to call the method.

Example

<%def name="renderPanel(panel)"> <div class="x-panel"> <h1 class="x-panel-title">${panel.title}</h1> <div class="x-panel-content"> </div> </div> </%def>

<%def name="renderTablePanel(panel)"> <%self:renderPanel panel="${panel}"> ${self.renderTable(panel.table)} </%self> </%def>

Error

`SyntaxException: Closing tag does not match tag: <%self:renderpanel> in file 'panels.mao' at line: 46 char: 2`

Comments (3)

  1. guest reporter

    Missed out the caller.body in the example:

    <%def name="renderPanel(panel)"> <div class="x-panel"> <h1 class="x-panel-title">${panel.title}</h1> <div class="x-panel-content"> ${caller.body()} </div> </div> </%def>

    <%def name="renderTablePanel(panel)"> <%self:renderPanel panel="${panel}"> ${self.renderTable(panel.table)} </%self> </%def>

  2. guest reporter

    The attached patch appears to fix the error, I've no idea if the .lower() was only required just makes things case sensitive?

  3. Log in to comment