patterns icon indicating copy to clipboard operation
patterns copied to clipboard

Extra blank line on code block

Open pickfire opened this issue 5 years ago • 10 comments

image

https://rust-unofficial.github.io/patterns/functional/index.html

The extra blank line look weird.

pickfire avatar Jan 03 '21 15:01 pickfire

I don't see much configuration options for that case under output.html.playground. Probably possible to influence via Custom.js/Custom.css but not sure if this is the scope of this project. Maybe more an upstream issue to get a setting for it and a bit of personal preference.

simonsan avatar Jan 04 '21 07:01 simonsan

Yeah, after I create the issue I noticed that it doesn't seemed to be an issue for this repo. I thought that it was somehow changed here, I didn't track the change for mdbook so most likely they changed it somewhere.

But weird, their examples does not have the blank lines.

image

https://rust-lang.github.io/mdBook/format/theme/syntax-highlighting.html

pickfire avatar Jan 04 '21 17:01 pickfire

Please keep us updated if it's an issue we could fix easily with js/css/theme-based approach. ;-)

simonsan avatar Jan 04 '21 17:01 simonsan

2021-01-05 11_24_09-Window-Screenshot

Fixed. Don't asked me why. :-) Feel free to reopen if it isn't fixed on your side still.

simonsan avatar Jan 05 '21 10:01 simonsan

mem-replace

2021-01-05 21_41_39-mem__replace(_) - Rust Design Patterns – Mozilla Firefox-Screenshot

dtor-finally 2021-01-05 21_42_05-Finalisation in Destructors - Rust Design Patterns – Mozilla Firefox-Screenshot

on-stack-dyn-dispatch 2021-01-05 21_42_27-On-Stack Dynamic Dispatch - Rust Design Patterns – Mozilla Firefox-Screenshot

:-D

Reopening.

simonsan avatar Jan 05 '21 20:01 simonsan

Should we keep this opened? I mean that's something that we cannot control..

marcoieni avatar Jan 05 '21 22:01 marcoieni

Should we keep this opened? I mean that's something that we cannot control..

Yeah, I would keep it open as an upstream issue to track. Seeing three different variants in the book I'm also interested now what's going on there, so I would prefer to leave it open.

simonsan avatar Jan 06 '21 07:01 simonsan

Tracking: https://github.com/rust-lang/mdBook/issues/1433

simonsan avatar Jan 11 '21 18:01 simonsan

I think in some cases it puts an empty space but in some cases it does not, so weird.

I believe adding # fn main() there is no new line. As mentioned by dtolnay. https://github.com/rust-lang/mdBook/issues/1433#issuecomment-755848991

pickfire avatar Jan 14 '21 15:01 pickfire

Ok, but I prefer to wait for the actual fix instead of adding # fn main() all over the place.

marcoieni avatar Jan 14 '21 21:01 marcoieni