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

on em-dashes #4

Open
goretkin opened this issue Feb 18, 2021 · 1 comment
Open

on em-dashes #4

goretkin opened this issue Feb 18, 2021 · 1 comment

Comments

@goretkin
Copy link

In e.g. markdown, depending on what convention is used for spaces around em-dash, you can get different results after applying semantic line breaks. It seems that that dictates using spaces around em-dashes in the source. Perhaps this can be mentioned.

sentence-per-line, no em-dash spaces:

The food—which was delicious—reminded me of home.
The food, which was delicious, reminded me of home.

clause-per-line, inconsistent em-dash spaces:

The food
—which was delicious—
reminded me of home.
The food,
which was delicious,
reminded me of home.

I could instead use

sentence-per-line, em-dash spaces:

The food — which was delicious — reminded me of home.

and

clause-per-line, em-dash spaces:

The food
— which was delicious —
reminded me of home.

which render the same as each other and make the em-dash spacing situation consistent with the comma situation.

Gist of four snippets, with rendering:
https://gist.github.com/goretkin/ab383aafaac4aa08d057b1c48fd196fd
(github issues use a flavor of markdown that does not support semantic line breaks)

@mtsknn
Copy link
Contributor

mtsknn commented May 9, 2021

I have been thinking about this too.

Em-dashes are usually not surrounded by spaces. See:

It's unfortunate that em-dashes without spaces don't work well with semantic line breaks. On the other hand, the specification recommends adding a line break after an em-dash:

A semantic line break SHOULD occur after an independent clause as punctuated by a comma (,), semicolon (;), colon (:), or em dash (—).

So yea, perhaps this should be clarified. I'm not sure how.

I personally use en-dashes surrounded by spaces and wrap my code like this:

The food –
which was delicious –
reminded me of home.

I think en-dashes with spaces read better on the web than em-dashes without spaces. The spec doesn't mention en-dashes at all – perhaps it should?

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

2 participants