How to handle quotes in quotes in quotes with jinja/html?

Alma

I can find many posts about escapiang quotes for rendering them on a page, but in my case I want to make

               <button onclick="window.location.href='{{ url_for("admin.pairs(entry.id)") }}';">
                   PP
               </button>                    

So onclick is followed by something that needs to be in quotes, and inside I have href which is followed by something else that needs to be in quotes, which is followed by url_for which contains something that needs to be in quotes. So I try to change between single and double quotes as such: " ' "" ' ", but it is not working. So in this case, which quotes need to be escaped? Or is it about something else?

Simeon Nedkov

One approach is to store the result of url_for in a variable and use it instead of calling url_for.

{% set url = url_for("admin.pairs(entry.id)") %}

<button onclick="window.location.href='{{ url }}';">PP</button>  

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to handle a string with quotes in it?

From Dev

How to find quotes with double quotes?

From Dev

simplexml handle quotes into entities

From Dev

how to handle quotes and semicolon in bsub command

From Dev

How to handle double quotes in JSON value?

From Dev

How to handle single quotes in Postgresql query

From Javascript

How to replace double quotes nested in another double quotes with single quotes

From Dev

How to escape single quotes into double quotes into single quotes

From Dev

How to use quotes within quotes properly

From Dev

How to write quotes inside quotes - Wordpress

From Dev

How to use double quotes inside double quotes

From Dev

How to remove quotes in between quotes using Regex?

From Dev

How to insert variables in quotes inside quotes in JavaScript

From Dev

single quotes vs double quotes, how to arrange?

From Dev

How to put quotes between other quotes in HTML

From Dev

Python CSV writer, how to handle quotes in order to avoid triple quotes in output

From Dev

SSIS: how to handle a quote-qualified csv file with quotes inside quotes

From

Escaping quotes and double quotes

From Dev

Quotes within quotes

From

How to marshal and escape quotes

From Dev

How to remove the double quotes?

From Dev

How to escape quotes in bash?

From Dev

how to filter inner quotes?

From Dev

How to escape quotes in shell?

From Dev

How to parse quotes correctly?

From Dev

How to escape quotes in PHP?

From Dev

How to add quotes to conditions?

From Dev

PHP MySQLI prepared insert to handle quotes and double quotes

From Dev

How to handle quotes inside strings when writing parsers?