Skip to content

Commit

Permalink
Closes #70: Add escapejs filter to diff template (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
miaow2 authored Jun 30, 2024
1 parent 0980a05 commit b52db25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h5 class="card-header">Diff</h5>
stickyFileHeaders: false,
drawFileList: false,
};
const jsonDiff = `{{ instance.diff|safe }}`;
const jsonDiff = `{{ instance.diff|escapejs|safe }}`;
var targetElement = document.getElementById('diffElement');
var diff2htmlUi = new Diff2HtmlUI(targetElement, jsonDiff, configuration);
diff2htmlUi.draw();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h5 class="card-header">{{ device_name }} - Diff</h5>
stickyFileHeaders: false,
drawFileList: false,
};
const jsonDiff = `{{ data|safe }}`;
const jsonDiff = `{{ data|escapejs|safe }}`;
var targetElement = document.getElementById('{{ device_name }}-diffElement');
var diff2htmlUi = new Diff2HtmlUI(targetElement, jsonDiff, configuration);
diff2htmlUi.draw();
Expand Down

0 comments on commit b52db25

Please sign in to comment.