Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rules regarding linebreaks #3

Open
notslang opened this issue Feb 3, 2016 · 0 comments
Open

add rules regarding linebreaks #3

notslang opened this issue Feb 3, 2016 · 0 comments

Comments

@notslang
Copy link
Owner

notslang commented Feb 3, 2016

from notslang/atom-tidy-markdown#24:

The reason why it converts trailing whitespace into a <br> is because trailing whitespace is difficult to notice in most editor configurations (including the Atom configuration used in that GIF). In order to see it, you need to have "invisibles" set to display and even then it causes issues with editorconfig settings that are set to strip trailing whitespace or other code normalization tools. For example, view the below Markdown sample and try to tell what it will render into:

# test

this first line may or may not have trailing whitespace  
which may or may not cause a break before this line

Maybe even screen-shot it, or print it out and try to tell what the author intended. Over all, using trailing whitespace to indicate document layout is just a really bad syntax feature.

I can see the issue; <br>s are also pretty ugly, but they are compiled into the same thing and at least they're explicit so they cannot be confused for a typing mistake like whitespace can. Also, actually needing a line break is pretty rare. Usually you'd separate bodies of text by dividing them into paragraphs so the text can reflow depending upon the size of the screen / paper. For that reason, I think that the ugliness is a good trade-off for explicitness in the places where it is needed.

The main use-case is text that is formatting-sensitive, but isn't code, like addresses or poems. I do agree that the following example isn't quite right.

221B Baker St<br>London, NW1 6XE<br>England

We should change the styleguide to make it look like this:

221B Baker St<br>
London, NW1 6XE<br>
England
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant