Skip to content

Commit

Permalink
split long line in diff view
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 30, 2024
1 parent d14281a commit 93f278c
Showing 1 changed file with 55 additions and 51 deletions.
106 changes: 55 additions & 51 deletions server/templates/patch.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
.diff .d2h-code-line-ctn, .diff .d2h-code-line *, .diff * {
font-family: Consolas, Menlo, monospace !important;
}
#summaryDiffElement .d2h-code-line, #summaryDiffElement .d2h-code-line-ctn {
white-space: normal;
}
</style>
{% endblock %}

Expand Down Expand Up @@ -191,67 +195,67 @@

{% if name_patch %}
<script>
(() => {
const diffString = {{ name_patch | tojson }};
const targetElement = document.getElementById('nameDiffElement');
const configuration = {
drawFileList: false,
fileListToggle: false,
fileListStartVisible: false,
fileContentToggle: false,
maxLineSizeInBlockForComparison: 80,
matching: 'words',
outputFormat: 'line-by-line',
synchronisedScroll: true,
renderNothingWhenEmpty: false,
};
const diff2htmlUi = new Diff2HtmlUI(targetElement, diffString, configuration);
diff2htmlUi.draw();
})()
(() => {
const diffString = {{ name_patch | tojson }};
const targetElement = document.getElementById('nameDiffElement');
const configuration = {
drawFileList: false,
fileListToggle: false,
fileListStartVisible: false,
fileContentToggle: false,
maxLineSizeInBlockForComparison: 80,
matching: 'words',
outputFormat: 'line-by-line',
synchronisedScroll: true,
renderNothingWhenEmpty: false,
};
const diff2htmlUi = new Diff2HtmlUI(targetElement, diffString, configuration);
diff2htmlUi.draw();
})()
</script>
{% endif %}

{% if infobox_patch %}
<script>
(() => {
const diffString = {{ infobox_patch | tojson }};
const targetElement = document.getElementById('infoboxDiffElement');
const configuration = {
drawFileList: false,
fileListToggle: false,
fileListStartVisible: false,
fileContentToggle: false,
matching: 'lines',
maxLineSizeInBlockForComparison: 80,
outputFormat: 'side-by-side',
synchronisedScroll: true,
renderNothingWhenEmpty: false,
};
const diff2htmlUi = new Diff2HtmlUI(targetElement, diffString, configuration);
diff2htmlUi.draw();
})()
(() => {
const diffString = {{ infobox_patch | tojson }};
const targetElement = document.getElementById('infoboxDiffElement');
const configuration = {
drawFileList: false,
fileListToggle: false,
fileListStartVisible: false,
fileContentToggle: false,
matching: 'lines',
maxLineSizeInBlockForComparison: 80,
outputFormat: 'side-by-side',
synchronisedScroll: true,
renderNothingWhenEmpty: false,
};
const diff2htmlUi = new Diff2HtmlUI(targetElement, diffString, configuration);
diff2htmlUi.draw();
})()
</script>
{% endif %}

{% if summary_patch %}
<script>
(() => {
const diffString = {{ summary_patch | tojson }};
const targetElement = document.getElementById('summaryDiffElement');
const configuration = {
drawFileList: false,
fileListToggle: false,
fileListStartVisible: false,
maxLineSizeInBlockForComparison: 80,
fileContentToggle: false,
matching: 'lines',
outputFormat: 'side-by-side',
synchronisedScroll: true,
renderNothingWhenEmpty: false,
};
const diff2htmlUi = new Diff2HtmlUI(targetElement, diffString, configuration);
diff2htmlUi.draw();
})()
(() => {
const diffString = {{ summary_patch | tojson }};
const targetElement = document.getElementById('summaryDiffElement');
const configuration = {
drawFileList: false,
fileListToggle: false,
fileListStartVisible: false,
maxLineSizeInBlockForComparison: 80,
fileContentToggle: false,
matching: 'lines',
outputFormat: 'side-by-side',
synchronisedScroll: true,
renderNothingWhenEmpty: false,
};
const diff2htmlUi = new Diff2HtmlUI(targetElement, diffString, configuration);
diff2htmlUi.draw();
})()
</script>
{% endif %}
{% endblock %}

0 comments on commit 93f278c

Please sign in to comment.