-
Notifications
You must be signed in to change notification settings - Fork 286
fix: Only allow selection line content instead of parent element #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
width: 100%; | ||
} | ||
|
||
.d2h-code-line-ctn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason this isn't working as good is that these rules are currently partly overridden by the ones in line 149.
Also it looks like this then needs the following style so it is aliged correctly. (On both .d2h-code-line-ctn
and .d2h-code-line-prefix
):
vertical-align: middle;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff --git a/src/ui/css/diff2html.css b/src/ui/css/diff2html.css
index a657891..bc267dc 100644
--- a/src/ui/css/diff2html.css
+++ b/src/ui/css/diff2html.css
@@ -113,12 +113,6 @@
width: 100%;
}
-.d2h-code-line-ctn {
- display: inline-block;
- user-select: text;
- width: 100%;
-}
-
.d2h-code-line del,
.d2h-code-side-line del {
display: inline-block;
@@ -144,14 +138,18 @@
padding: 0;
word-wrap: normal;
white-space: pre;
+ vertical-align: middle;
}
.d2h-code-line-ctn {
- display: inline;
+ display: inline-block;
background: none;
padding: 0;
word-wrap: normal;
white-space: pre;
+ user-select: text;
+ width: 100%;
+ vertical-align: middle;
}
.line-num1 {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, this works fine. I just did not understand the difference caused by the vertical-align.
Maybe it matters for different font sizes or other changes in the style?
dbdb704
to
33076dc
Compare
@campersau if it looks good for you, should I go ahead and merge it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #346