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

variable concatenation #{} inside blocktrans with "with" arguments ignoring variables #54

Open
ewen-lbh opened this issue Jun 26, 2019 · 0 comments

Comments

@ewen-lbh
Copy link

  • pypugjs version: 5.8.1
  • Django version: 2.2.2
  • Python version: 3.6.8
  • Operating System: Pop!_OS 18.10

Description

I was trying to use a -blocktrans with stuff=thing and use the variables inside.
Relevant snippet:

-block header_description
    if collection.tracks|length > 1
        -blocktrans with trackscount=collection.tracks|length kind=collection.get_kind_display
            | #{trackscount}-tracks #{kind}
    else
        | #{collection.get_kind_display|title}
    br/
    | released #{collection.date|date:"SHORT_DATE_FORMAT"}

I was expecting to get this:

But I got this:

I fixed it by using

{{trackscount}}-tracks {{kind}}

instead of

#{trackscount}-tracks #{kind}

I wish we could use pug's syntax tho, as my syntax highlighter does not understand plain django syntax inside pug files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant