Skip to content

Commit 1f261e6

Browse files
authored
Merge pull request #348 from rtfpessoa/only-allow-selection-line-content
fix: Only allow selection line content instead of parent element
2 parents e48259d + 33076dc commit 1f261e6

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/ui/css/diff2html.css

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,40 @@
9696
.d2h-code-line {
9797
display: inline-block;
9898
white-space: nowrap;
99+
user-select: none;
100+
width: 100%;
99101
/* Compensate for the absolute positioning of the line numbers */
100102
padding: 0 8em;
101103
}
102104

103105
.d2h-code-side-line {
104106
display: inline-block;
105107
white-space: nowrap;
108+
user-select: none;
109+
width: 100%;
106110
/* Compensate for the absolute positioning of the line numbers */
107111
padding: 0 4.5em;
108112
}
109113

114+
.d2h-code-line-ctn {
115+
display: inline-block;
116+
background: none;
117+
padding: 0;
118+
word-wrap: normal;
119+
white-space: pre;
120+
user-select: text;
121+
width: 100%;
122+
vertical-align: middle;
123+
}
124+
110125
.d2h-code-line del,
111126
.d2h-code-side-line del {
112127
display: inline-block;
113128
margin-top: -1px;
114129
text-decoration: none;
115130
background-color: #ffb6ba;
116131
border-radius: 0.2em;
132+
vertical-align: middle;
117133
}
118134

119135
.d2h-code-line ins,
@@ -124,6 +140,7 @@
124140
background-color: #97f295;
125141
border-radius: 0.2em;
126142
text-align: left;
143+
vertical-align: middle;
127144
}
128145

129146
.d2h-code-line-prefix {
@@ -134,14 +151,6 @@
134151
white-space: pre;
135152
}
136153

137-
.d2h-code-line-ctn {
138-
display: inline;
139-
background: none;
140-
padding: 0;
141-
word-wrap: normal;
142-
white-space: pre;
143-
}
144-
145154
.line-num1 {
146155
box-sizing: border-box;
147156
float: left;

0 commit comments

Comments
 (0)