### Bug description

Thanks for the great package! I've very much enjoyed using it.

My bug is related to [#834](https://github.com/quarto-dev/quarto-cli/issues/834). In the example below, the 4th reference note is still being placed on top of the previous note.

```
---
format: html
reference-location: margin
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.[^1] Ut enim ad minim veniam, quis nostrud exercitation, Ut enim ad minim veniam, quis nostrud exercitation.[^2] Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.[^3]

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.[^4]

[^1]: This is citation number 1, Lorem ipsum dolor sit amet
[^2]: This is citation number 2, which is even longer. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Ut enim ad minim veniam, quis nostrud exercitation.
[^3]: This is citation number 3, which is still placed nicely in the margin. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
[^4]: The problem is with the position of this last citation, number 4.
```

![image](https://user-images.githubusercontent.com/25727441/174860373-64e00c0a-6283-4011-b2ed-68ef641bbe2d.png)

I'm running Quarto Version: 0.9.603 on R version 4.1.0 in RStudio 2022.02.3+492 for macOS.

dragonstyle
2022-06-21T17:31:25Z
jdjohn215
bug verify-fixed
1.0
closed
References in margin not correctly placed when long references and several short paragraphs (related to #834)
https://github.com/quarto-dev/quarto-cli/issues/1197