Crates.io: Extra newlines appear in rendered README

Created on 19 Aug 2017  路  3Comments  路  Source: rust-lang/crates.io

I'm so excited that README files now show up in crates.io! I started using it without even realising and then when I saw that it was there I was so happy! :smile:

I noticed that the css-color-parser has a lot of extra newlines for some reason when it is shown on crates.io vs. when it is shown on GitHub. There is a lot of extra space between bullets and after paragraphs which GitHub is able to collapse but crates.io does not.

Looking at the README, the author of that package seems to have added a <br> after every line for whatever reason. This is further exacerbated on crates.io in certain places because the inserted paragraph tags have additional space due to the <br>s added everywhere (see just after the word Reliable in the README). Crates.io should probably collapse all of that extra space together in the same way that GitHub does.

GitHub: https://github.com/7thSigil/css-color-parser-rs
Crates.io: https://crates.io/crates/css-color-parser

Screenshots: (click to view full size)

screencapture-crates-io-crates-css-color-parser-1503115712895

screencapture-github-7thsigil-css-color-parser-rs-1503115691837

A-frontend A-readme C-bug E-help-wanted

All 3 comments

Seems like the Markdown renderer renders this just fine, but after it gets sanitized, all the <br>s get closed and that's what does the weird stuff.


original.md
Easy-to-use Rust parser for CSS3 color strings.<br>
Lightweight.<br>
Reliable (Provides tests, handles all errors to avoid panic!s).<br>

Not 100% spec compliant in the name of convenience (see examples below):<br>
  * allows for extra whitespaces<br>
  * allows for floats where standard allows percentages only<br>
rendered.html
<p>Easy-to-use Rust parser for CSS3 color strings.<br>
Lightweight.<br>
Reliable (Provides tests, handles all errors to avoid panic!s).<br></p>
<p>Not 100% spec compliant in the name of convenience (see examples below):<br></p>
<ul>
<li>allows for extra whitespaces<br></li>
<li>allows for floats where standard allows percentages only<br></li>
</ul>
cleaned.html
<p>Easy-to-use Rust parser for CSS3 color strings.<br>
Lightweight.<br>
Reliable (Provides tests, handles all errors to avoid panic!s).<br></br></br></br></p>
<p>Not 100% spec compliant in the name of convenience (see examples below):<br></br></p>
<ul>
<li>allows for extra whitespaces<br></br></li>
<li>allows for floats where standard allows percentages only<br></br></li>
</ul>

This is fixed in ammonia 0.6 :)

Upgraded, deployed, and confirmed fixed!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XuShaohua picture XuShaohua  路  5Comments

vignesh-sankaran picture vignesh-sankaran  路  5Comments

Turbo87 picture Turbo87  路  7Comments

seeekr picture seeekr  路  7Comments

pczarn picture pczarn  路  7Comments