rust-lang / prev.rust-lang.org

The previous Rust website. The current website's code is at https://github.com/rust-lang/www.rust-lang.org.
https://prev.rust-lang.org
Apache License 2.0
151 stars 340 forks source link

Inline CSS in code examples messes with spacing #1198

Open picklesecond opened 5 years ago

picklesecond commented 5 years ago

The current homepage looks like this (for me -- I accept both English and Chinese but prefer English so perhaps there is a localization issue?).

asseenubuntufirefox

This is jacked up, clearly, so I looked around a little. Noticed this css effect is on purpose:

inlinecssisdefault

And while removing it doesn't make it a perfect rainbow of beauty, the text doesn't overlap anymore.

afterremovinginlinecss

JS used is

document.querySelectorAll(".ace_text-layer .ace_line").forEach((e) => e.style.height = "")

But obviously it would be better to figure out where the inline css is coming from and stop it from being added. I can do that if you guys need.