karunpoudel commented on code in PR #22744:
URL: https://github.com/apache/airflow/pull/22744#discussion_r842776448
##########
airflow/www/templates/airflow/gantt.html:
##########
@@ -79,6 +79,6 @@
<script src="{{ url_for_asset('gantt.js') }}"></script>
<script>
// Loading data via <meta> wasn't loading extra_links in a task
- const data = JSON.parse('{{ data|tojson }}');
+ const data = JSON.parse('{{ data|tojson|replace("\\", "\\\\") }}');
Review Comment:
I think \ is only problem here because every other character has already be
escaped by \ , now, we need to escape the \ that is used to escape other
character. There is
[forceescape()](https://jinja.palletsprojects.com/en/3.1.x/templates/#jinja-filters.forceescape)
filter available but it will escape doublequote more suitable for html rather
than javacript string.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]