Repository: rust-lang/mdBook (language: rust)

Issue:
Footnote line height adds too much space.
### Problem

When there is a footnote on a multi-line paragraph, the line with the footnote ends up adding some extra vertical space to the line:

<img width="653" alt="image" src="https://github.com/user-attachments/assets/67cc3f2e-ef02-49c4-9b1b-9acad16f040d">

I don't think it looks very good, and would like to see some kind of solution to avoid that.

### Steps

Have a multi-line paragraph with a footnote after the first line.

### Possible Solution(s)

_No response_

### Notes

_No response_

### Version

```text
mdbook v0.4.40
```



Discussion / hints:
Hi! I was wondering if it was okay if I made a pull request for this issue?

I did read the contributions guideline and it said that I was free to claim the issue but this is my first time contributing so I was a bit nervous.

#### Possible Issue
I think this issue was because the all the text in the paragraph **already has a line-height of 1.5** and the **footnote-reference gets another line-height of 1.5** leading to this issue.


#### Solution
The only change I made was adding this piece of css

    .footnote-reference{
	    line-height: 0;
    }


### Before
![Before](https://github.com/user-attachments/assets/601e8e30-2e6c-4595-8116-dd1c509ff6e9)

### After
![After](https://github.com/user-attachments/assets/16f9b5c7-557a-47a6-a722-fdc065bce662)

If it works on all the major browsers (chrome, safari, firefox, mobile safari, mobile chrome), and doesn't overlap with descenders of the previous line, then sounds great to me to get this fixed!


Fix patch:
diff --git a/src/theme/css/general.css b/src/theme/css/general.css
index 7670b087d3..0862b51673 100644
--- a/src/theme/css/general.css
+++ b/src/theme/css/general.css
@@ -190,6 +190,16 @@ kbd {
     vertical-align: middle;
 }
 
+sup {
+    /* Set the line-height for superscript and footnote references so that there
+       isn't an awkward space appearing above lines that contain the footnote.
+
+       See https://github.com/rust-lang/mdBook/pull/2443#discussion_r1813773583
+       for an explanation.
+    */
+    line-height: 0;
+}
+
 :not(.footnote-definition) + .footnote-definition,
 .footnote-definition + :not(.footnote-definition) {
     margin-block-start: 2em;


Test patch: