Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Document template inheritance block naming restrictions #1090

Open
@malteneuss

Description

@malteneuss

I just stumbled upon an unexpected quirk where apparently hyphens are not allowed in template block names:

<html lang="en">
  <head>
    {% block a-head %}{% endblock %}
  </head>
</html>

results in a vague error like

error: problems parsing template source at row 7, column 15 near:
       "head %}\n..."
  --> website/src/routes.rs:12:10
   |
12 | #[derive(Template)]

while {% block head %} works as expected. I would like to document the naming restrictions if someone knows them or could point me to source code that parses such expressions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions