From 49bb384963f8227128168657eba3e2546052dad4 Mon Sep 17 00:00:00 2001 From: Rodrigo Fernandes Date: Tue, 27 Oct 2020 20:19:26 +0000 Subject: [PATCH] fix: Use GitHub style line prefix and fix code selection --- src/templates/generic-line.mustache | 13 +------------ src/ui/css/diff2html.css | 8 ++++++-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/templates/generic-line.mustache b/src/templates/generic-line.mustache index 37ed7a16..145eb195 100644 --- a/src/templates/generic-line.mustache +++ b/src/templates/generic-line.mustache @@ -4,18 +4,7 @@
- {{#prefix}} - {{{prefix}}} - {{/prefix}} - {{^prefix}} -   - {{/prefix}} - {{#content}} - {{{content}}} - {{/content}} - {{^content}} -
- {{/content}} + {{#content}}{{{content}}}{{/content}}{{^content}}
{{/content}}
diff --git a/src/ui/css/diff2html.css b/src/ui/css/diff2html.css index acd5db52..f211075b 100644 --- a/src/ui/css/diff2html.css +++ b/src/ui/css/diff2html.css @@ -126,12 +126,16 @@ text-align: left; } -.d2h-code-line-prefix { +/* .d2h-code-line-prefix { display: inline; background: none; padding: 0; word-wrap: normal; white-space: pre; +} */ + +.d2h-code-line-ctn:before { + content: attr(data-prefix); } .d2h-code-line-ctn { @@ -207,7 +211,7 @@ .d2h-code-linenumber, .d2h-code-side-linenumber, -.d2h-code-line-prefix, +/* .d2h-code-line-prefix, */ .d2h-emptyplaceholder { user-select: none; }