Skip to content

Commit a8cd23c

Browse files
authored
Fix tree view if config contains " (#9250)
If you run DAG with `{"\"": ""}` configuration tree view will be broken: ``` tree:1 Uncaught SyntaxError: Unexpected string in JSON at position 806 at JSON.parse (<anonymous>) at tree?dag_id=hightlight_test&num_runs=25:1190 ``` JSON.parse is given incorrectly escaped json string.
1 parent e5ce87a commit a8cd23c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

airflow/www/templates/airflow/tree.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136

137137
var devicePixelRatio = window.devicePixelRatio || 1;
138138
// JSON.parse is faster for large payloads than an object literal (because the JSON grammer is simpler!)
139-
var data = JSON.parse('{{ data }}');
139+
var data = JSON.parse({{ data|tojson }});
140140
var barHeight = 20;
141141
var axisHeight = 40;
142142
var square_x = parseInt(500 * devicePixelRatio);

0 commit comments

Comments
 (0)