Skip to content

Plim doesn't respect mako's ## comments properly. #41

@mfeif

Description

@mfeif

I know that Plim has it's own comment feature ( / ) but ignoring Mako's commenting symbols ( ## ) means that you have to change the mako files to work with plim. Normally, that's no big deal, since plim supports its own versions of what mako does, and in your documents, you can just use plim's /

But it means that we can't put comments in inherited or namespaced files, which may NOT be plim files, but are "pure" mako files.

For example, I have a helpers.mako file that contains some things I want to pull into other documents/templates. So far, so good; I can grab these through standard Mako tools, either in pure mako or in plim.

But if I want to put a comment in that PURE mako file, plim doesn't respect it. The below will output both sets of text if plim is used as a pre-processor on documents that inherit this block and use it. It seems to want to make a div with the id "#" which is non-sensical (and perhaps invalid html) but makes sense according to the #myid use case.

<%block name="something_to_use_elsewhere">
<p>This should be here.</p>
## But this should not.
</%block>

renders as

<%block name="something_to_use_elsewhere">
<p>This should be here.</p>
<div id="#">But this should not.</div></%block>

And if I change the ## into a / to suit plim, then I have invalid mako, and other code can't use it. Well, not invalid, but again, it's not interpreted as a comment.

What's weird is that in the docs here http://plim.readthedocs.org/en/latest/en/syntax.html#new-style-blocks it uses a # to make a comment in the generated mako code, but not at the beginning of a line.

I don't see anyplace where ## is already used by plim, can we make it either pass through, or ... something? Losing <div id="#"> doesn't seem so bad ;-)

tl;dr, can we have mako comments back?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions