pieterh wrote on 18 Feb 2010 12:14
New strikethrough syntax
This is a design sketch for a new strikethrough syntax that fixes an old design error in the syntax, where double hyphen is used both for strikethrough and for em-dash.
- We add a new strikethrough command '==' that works like the current strikethrough but does not conflict with em-dashes.
- We change the way the old strikethrough works to make it safe with em-dashes and yet remain backwards compatible with most existing strikethrough.
- We deprecate the old strikethrough and discourage its use.
To make the old strikethrough safe, we restrict it to a specific case:
This is a design sketch for a new strikethrough syntax that fixes an old design error in the syntax, where double hyphen is used both for strikethrough and for em-dash.
- We add a new strikethrough command '==' that works like the current strikethrough but does not conflict with em-dashes.
- We change the way the old strikethrough works to make it safe with em-dashes and yet remain backwards compatible with most existing strikethrough.
- We deprecate the old strikethrough and discourage its use.
To make the old strikethrough safe, we restrict it to a specific case:
- The opening -- must have a space, start of the line, or other non-word character before it, and must be immediately followed by a word character.
- The closing -- must have a space, end of the line, or other non-word character after it, and must immediately follow a word character.
Examples:
This syntax | Produces this text |
---|---|
This--is a--string | This—is a—string |
This--is a string-- | This—is a string— |
This -- is a -- string | This — is a — string |
This --is a-- string | This is a string |
This --is a string-- | This is a string |
Thus existing strikethrough of whole words (the most common case) will still work, while em-dashes that use either the space or no-space style will display correctly.
This will generate another "error" | By michal-frackowiak | 1 Comments | 09 Mar 2010 13:01 |
I don't like en-dash | By Brunhilda | 6 Comments | 18 Feb 2010 22:42 |
We discourage direct comments on this thread: to discuss it, please start a sub-thread.