I suggest you ...

Add a switch for spacing around em-dashes

Add a togglable option on the page to enable/disable the insertion of spaces around em-dashes

5 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Mekki MacAulayAdminMekki MacAulay (Admin, cleantext) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    under review  ·  Mekki MacAulayAdminMekki MacAulay (Admin, cleantext) responded  · 

    As it stands, the code currently replaces sequences of two dashes with a single em dash, context notwithstanding; so text like this:

    Em dashes don’t take spaces either side—they’re like this.

    …would be converted to..:

    Em dashes don’t take spaces either side—they’re like this.

    …but text like this..:

    Em dashes don’t take spaces either side — they’re like this.

    …gets turned into..:

    Em dashes don’t take spaces either side — they’re like this.

    This is arguably a good idea, since it will respect whatever convention – correct or not – the user decides to follow. However, it will also dramatically mangle odd situations like this:

    -——————————————————————————
    | I am boxed text! That’s like boxed wine, but cooler. |
    -——————————————————————————

    …which becomes this kind of horrorshow..:

    ———————————————————————————-
    | I am boxed text! That’s like boxed wine, but cooler. |
    ———————————————————————————-

    …and pidgin ASCII Morse code..:

    - .— .- … / … .. .. .-.. .-.. .. -. / . . -.. / – …. . / … ... .. – …. .- / – —- …- . …

    …becomes..:

    - .— .- … / … .. .. .-.. .-.. .. —. / .- . -.. / – …. . / … ... .. – …. .— / – — …- . …

    …which almost looks valid when viewed with a fixed-width font, but which is just plain broken.

    I waded into this expecting to rewrite this whole function, but now I think that the best approach here is simply to leave it as is. The two oddball cases immediately above will still break, but the spacing before and after em dashes will simply honor whatever convention the text already follows, right or wrong.

    If anything, the option should be provided to remove spaces from around em dashes if the user so decides, but otherwise to leave them be; but for now I think we’ll stick with the known quantity.


    UPDATE (Mekki)

    We’re currently considering if this could be done with a 3-way switch, namely:

    1) Leave spacing around em-dashes as in submitted text
    2) Remove spacing around em-dashes
    3) Add spacing around em-dashes

    This would give the user some control to transform the text if the original spacing wasn’t as desired for the output. We’ll see if we can make this work.

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Ben ZaninAdminBen Zanin (Admin, cleantext) commented  ·   ·  Flag as inappropriate

        Mike, you're right about the correct usage of em dashes, of course, but I think it might - just might - be worth providing a toggle switch anyhow, with the default selected action to be the correct one.

        Still, that's something we can leave up to a vote. For now, the only action taken for em dashes is the incorrect one, and that clearly needs to be fixed. I'm working on it.

      • Mike DickisonMike Dickison commented  ·   ·  Flag as inappropriate

        No! This shouldn't exist. Either the en dash should be spaced – like this – or it's being used in a date/time range or a compound adjective, and shouldn't get spaces around it.

      Feedback and Knowledge Base