Skip to content
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

Bug report: excessive spacing in live preview #743

Closed
chrisgrieser opened this issue Dec 27, 2021 · 7 comments
Closed

Bug report: excessive spacing in live preview #743

chrisgrieser opened this issue Dec 27, 2021 · 7 comments
Assignees
Labels
bug Something isn't working.
Milestone

Comments

@chrisgrieser
Copy link
Contributor

chrisgrieser commented Dec 27, 2021

What happened?

using dv.paragraph or dv.span in live preview results in excessive spacing, that does occur on and off, but is reliably reproducible in the help vault where only dataview has been installed. see this video.

Screen.Recording.2021-12-27.at.23.31.42.mov

DQL

No response

JS

dv.paragraph ("- one two three\n- one two three\n- one two three\n- one two three\n- one two three\n- one two three\n- one two three\n- one two three");

Dataview Version

0.4.21

Obsidian Version

Obsidian 0.13.14

OS

MacOS

@whitenoisedev
Copy link

I noticed the same.
Also, in tasks, the distance between the checkbox and the text is much narrower in LP than in reading.

@blacksmithgu
Copy link
Owner

I'm just guessing, but LP may be using different HTML elements / CSS classes than the old renderer did. I'll see what I can do to fix it; I'm probably going to just focus on live preview support in the future over the legacy renderer now that they have feature parity.

@valentine195
Copy link

@blacksmithgu
Copy link
Owner

Why is there so much spacing by default on paragraph elements? That's kind of crazy.

@blacksmithgu
Copy link
Owner

The line-height property of live preview paragraphs is set to a very large amount - possibly the culprit?

@blacksmithgu blacksmithgu added the priority-high A fix is incoming for this in an upcoming patch version. label Jan 21, 2022
@valentine195
Copy link

The line-height property of live preview paragraphs is set to a very large amount - possibly the culprit?

Yes, a lot of styles are being inherited from the dynamic CM6 classes. Lists are especially bad, from a rogue white-space: pre-wrap.

I also found that the <br>s inserted in LP were rendering.

In general, the CSS I linked to in Admonitions made rendered markdown look the same as it does in Reading mode for me.

@blacksmithgu
Copy link
Owner

Messing too much with this appears to mess up table/list rendering, but I've applied a similar fix to paragraphs and spans to make them a little less painfully separated. I'll have to fine tune this more later once I understand live preview spacing better.

@blacksmithgu blacksmithgu removed the priority-high A fix is incoming for this in an upcoming patch version. label Jan 21, 2022
@blacksmithgu blacksmithgu added this to the 0.4.23 milestone Jan 21, 2022
blacksmithgu pushed a commit that referenced this issue Jan 21, 2022
- Fix #798: Fix duration -> string implementation to use `minimalDuration`.
- Fix #743: Improve paragraph/span spacing in live preview.
- Fix #775: Add empty result warnings to task view.
- Fix #733: Add `?no-dataview` to disable dataview renders.
- Fix #792: Fix block link detection in tasks.
- Fix #799: Fix 'Task' -> 'Calendar' documentation typo.
- Fix #789: Fix date(tomorrow) typo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

4 participants