Shopsys: .md files contains trailing whitespace

Created on 11 Sep 2018  路  5Comments  路  Source: shopsys/shopsys

What is happening

.md files contains trailing whitespace. This causes problems when your IDE automatically removes trailing whitespaces - this is a correct behavior in my opinion.

Expected result

Remove trailing whitespaces from .md files and create an automatic sniff/fixer for it.

Most helpful comment

I would like to point out that two spaces at the end of line have a special meaning in markdown - they indicate a line break. Removing them automatically may cause issues.

All 5 comments

@carusogabriel helped me to solve this with this bash script: https://github.com/Symplify/Symplify/blob/master/bin/clear_readmes.sh

I would like to point out that two spaces at the end of line have a special meaning in markdown - they indicate a line break. Removing them automatically may cause issues.

So what is the result @PetrHeinz? Shoud we remove trailing whitespace as @simara-svatopluk suggests?

@Miroslav-Stopka: I would recommend removing any whitespace from blank lines, a single spaces at the end of any line and leaving at most two spaces at the end.

Basically a regex replace of (?:^|( )?) *$ by \1 (not considering tabs).

580 fixed the issue and introduced new automated fixer

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rootpd picture rootpd  路  4Comments

TomasLudvik picture TomasLudvik  路  4Comments

boris-brtan picture boris-brtan  路  5Comments

grossmannmartin picture grossmannmartin  路  3Comments

vitek-rostislav picture vitek-rostislav  路  4Comments