Skip to content

Adding support for new Angular control flow #3451

@mihilion

Description

@mihilion

Pug Version: 3.0.2

Node Version: 18.20.3

Input JavaScript Values

pug.renderFile('input.pug', {
  whatIsIt: 'language',
});

Input Pug

@if (pugSupportsNewAngularControlFlow) {
  h1 I Love Pug
  p It's a great #{whatIsIt}
} @else {
  p Can you please add support for new angular control flow?
}    

Expected HTML

@if (pugSupportsNewAngularControlFlow) {
  <h1>I Love Pug</h1>
  <p>It's a great language</p>
} @else {
  <p>Can you please add support for new angular control flow?</p>
}  

Actual HTML

unexpected text "@if (" - line 1:1

Additional Comments

Angular introduced new control flow, which works in html templates: https://angular.dev/guide/templates/control-flow and
It would be great if pug could support it, with proper syntax highliting in IntelliJ (that part is perhaps on IntelliJ side, but pug needs to support the syntax first).

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