Skip to content

Escape quotes bug #109

@7iomka

Description

@7iomka

Example from docs with same quote interpolation

div(placeholder="{{ 'I\'m best of the best' | translate }}")

get me error

Trace: SyntaxError: Unexpected token, when trying to parse `{{ 'I'm best of the best' | translate }}`

I would like to know why I am getting errorsfor this case.
Thanks

PS: I think solution, but problem from above is a bug.

My solution:

  1. Excape self-made
placeholder="{{ "I'm best of the best" | translate }}"
  1. Auto escape by pug
placeholder=`{{ "I\'m best of the best" | translate }}`

BUT
My solution not working as needed if we have 2 types of quotes

placeholder=`{{ "I\'m best of the \"best\"" | translate }}`

That extract

msgid "I'm best of the "best""

instead of

msgid "I'm best of the \"best\""

How to fix this issues?
Thanks!

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