Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

410
Vistas
Jinja2 HTML templates use multiple nested quotation marks (" and ')

The question is simple, I am using jinja2 html templates and I am supposed to include {{ url_for('static', filename='img/background.png') }} inside of url(''), inside of style="".

The proble is that there is a quotation mark conflict, because there are two nested ' marks

<body id="body-pd" style="background: url('{{ url_for('static', filename='img/background.png') }}') no-repeat center center fixed; background-size: cover;">

Is there some sort of scape character to be used?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The answer to this problem is also very simple: there's no problem. The Jinja environment (server side) and browser/frontend environment have different lifecycle.

Jinja only sees this part:

{{ url_for('static', filename='img/background.png') }}

It produces a path, e.g. /static/img/background.png and replaces the whole {{ ... }} snippet with it. The frontend environment never sees Jinja-related parts. So there's no quotation mark conflict, because half of them will be eliminated by Jinja on the server side.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda