Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qute - support optional end tags for sections #33293

Closed
mkouba opened this issue May 11, 2023 · 0 comments · Fixed by #33296
Closed

Qute - support optional end tags for sections #33293

mkouba opened this issue May 11, 2023 · 0 comments · Fixed by #33296
Assignees
Labels
area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented May 11, 2023

Description

In some cases, it might be useful to support optional end tags. A typical example is the {#let} section.

Currently, the end tag is mandatory and defines the scope of the "local variables":

{#let foo=true}
  // foo can be used here
{/let}
// foo cannot be used here

However, it might be practical to make the end tag optional and bind the section to the parent:

{#let foo=true}
// foo can be used here

// synthetic {/let} added automatically
// foo cannot be used here
{#if baz}
{#let foo=true}
// foo can be used here

// synthetic {/let} added automatically
{/if}
// foo cannot be used here

By default, a missing end tag still results in a parser error. The strategy used will be controlled by the relevant SectionHelperFactory.

Implementation ideas

No response

@mkouba mkouba added the kind/enhancement New feature or request label May 11, 2023
@mkouba mkouba added this to the 3.1 - main milestone May 11, 2023
@quarkus-bot quarkus-bot bot added the area/qute The template engine label May 11, 2023
@mkouba mkouba self-assigned this May 11, 2023
mkouba added a commit to mkouba/quarkus that referenced this issue May 11, 2023
mkouba added a commit to mkouba/quarkus that referenced this issue May 11, 2023
manofthepeace pushed a commit to manofthepeace/quarkus that referenced this issue May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant