Removing trailing whitespace in markdown files will ruin line breaks.
To fix it the following settings needs to be added to the .editorconfig file:
[*.md]
trim_trailing_whitespace = false| Comment | File | Size | Author |
|---|---|---|---|
| #25 | drupal-2764829-25.patch | 1.48 KB | fathershawn |
| #24 | drupal-2764829-24.patch | 1.42 KB | fathershawn |
| #21 | drupal-2764829-21.patch | 1.46 KB | jrockowitz |
| #13 | 2764829-editorconfig-markdown-d8-8-13.patch | 1.23 KB | daniel korte |
| #8 | 2764829-editorconfig-markdown-d8-8.patch | 252 bytes | daniel korte |
Issue fork drupal-2764829
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
David_Rothstein commentedComment #8
daniel korteWill some patches get this issue moving again? :)
Comment #9
daniel korteComment #11
malcomio commentedThis patch applies cleanly against both the 8.9.x and 9.1.x branches, and fixes the problem for me.
Comment #12
alexpottWe need to change gitattributes too then... I.e. I think that
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2needs to change to
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,-trailing-space,tabwidth=2Otherwise using git to fix white issues will not work.
Also I didn't know about this use of trailing whitespace in markdown... very meh.
Comment #13
daniel korteUpdated!
Comment #14
alexpottSo I guess the one question is... are we really sure about this? Yes this is a feature of markdown. But other projects do not do this...
https://github.com/symfony/symfony/blob/5.x/.editorconfig
But some do...
https://github.com/laravel/laravel/blob/master/.editorconfig
https://github.com/facebook/react/blob/master/.editorconfig
https://github.com/vuejs/vue/blob/dev/.editorconfig
So okay it seems fine to do... fun. TIL markdown has significant whitespace at the end of a line... seems an interesting decision.
Comment #16
alexpottRandom unrelated JS fail
Comment #17
alexpottComment #21
jrockowitz commentedBecause of #3084326: Install .editorconfig and .gitattributes at the project root I think this patch needs to alter the files in /core/assets/scaffold/files.
The patch did not apply to my composer based installation.
Comment #24
fathershawnRefactored the patch from #21 to the working directory chosen by composer.
Which also didn't apply with composer...
Comment #25
fathershawnThis patch applied via composer locally however