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

mdash, ndash, strikethrough #16

Closed
pmario opened this issue Jun 12, 2012 · 10 comments
Closed

mdash, ndash, strikethrough #16

pmario opened this issue Jun 12, 2012 · 10 comments

Comments

@pmario
Copy link
Member

pmario commented Jun 12, 2012

If you copy the following source to a TW5 tiddler you'll see what I mean:

{{{
some text -- ndash --- mdash end -> ok
}}}
some text -- ndash --- mdash end -> ok

{{{
some text --strike start -- ndash --- mdash strike end--  -> nok
}}}
some text --strike start -- ndash --- mdash strike end--  -> nok
@Jermolene
Copy link
Member

You're correct, the parser manages to distinguish between dashes and the opening of a strikethrough section, but it struggles to distinguish an mdash from a closing strikethrough section.

The resulting restriction of not being able to use ndashes and mdashes within a strikethrough section doesn't seem to onerous to me, and I'd be inclined to leave it like this. What do you think?

@pmario
Copy link
Member Author

pmario commented Jun 13, 2012

I'd ask myself: "When is ndash, mdash used?"

  • It's used, during writing
    • Using an html entity interrupts the writers flow.
    • Having propper n-mdash handling introduces a better workflow for writers.

I'd also ask: "When is strikethrough used?"

  • imo it's used during a review, or
  • if someone points out an error and the author doesn't want to invalididate a readers comment, by simply fixing the text.
    • So covering a text within eg: {{deleted{}}} and add something like:"Thanks to JonDo pointing out ..." will do fine.
    • <del>..</del> [2][4] may be used too, depending on a writers taste.
    • Imo <del>..</del> or {{deleted{}}} in "raw text view" is syntactically cleaner and more visible than --bla bla--

According to wikipedia [3] "ndash Spacing" section, having n-mdash will allways conflict with strikethrough detection because:

  • compare: 12 June – 3 July with 12 June–3 July, where the first range is well formed and the second is "bad"

Conclusion:

  • -- .. allways creates a ndash
  • --- .. allways creates a mdash
  • <del datetime="2009-10-11T01:25-07:00">..</del> or {{deleted{}}} .. creates a strikethrough [4].

I know that this is a compatibility issue, but as you said: TW5 should be a 100 times more popular than TW2. Imo a good migration path (plugin/SPA) can handle this.

Imo the above can create better html5 code [4] if done right.

@FND @cdent @bengillies what do you think?

[1] http://wikicreole.org/wiki/Creole1.0
[2] https://developer.mozilla.org/en/HTML/Element/strike
[3] http://en.wikipedia.org/wiki/Ndash#Spacing
[4] http://dev.w3.org/html5/spec/the-del-element.html#the-del-element

@Jermolene
Copy link
Member

OK, I think you might have a point: that strikethrough is mainly used for marking text during review, and that the syntax isn't really very useful for this.

Strikethrough also seems to be widely used to indicate something that has been completed.

I'm not a fan of the <del> syntax because of the confusion now we've got HTML tags intermingled within wikitext.

Hmmm. Would it be madness to have:

  • -- always creates a ndash
  • --- always creates a mdash
  • ----strikethrough---- for strikethrough?

Four dashes is rather a lot, but it does allow us to keep the markup looking intuitive, and there's your very reasonable argument that strikethrough is rare in narrative text.

UPDATE: I forgot about the <hr> rule already taking four dashes. Hmmm.

@cdent
Copy link

cdent commented Jun 13, 2012

Is it important to have both en and em dashes? In my experience it is the em dash that people are actually after. So one option is:

  • -- emdash
  • ---strike--- strikethrough
  • ---- horz rule

@pmario
Copy link
Member Author

pmario commented Jun 13, 2012

I could live with ----strikethrough---- and it will be quite visible

the hr ---- is allways ended with a linebreak \n. right?

@bengillies
Copy link

These seem of relevance here:

http://www.tbray.org/ongoing/When/201x/2010/12/30/How-To-Dash
http://www.kajhaffenden.com/articles/em-dash-en-dash-hyphen/

I seems that there are distinct use cases for each, though I agree
with Chris, em dash is likely the more widely used case.

I think the ambiguity is in telling the difference between
strikethroughs and em dashes. To my mind, 3 hyphens is excessive. I
would think the following would result in the correct result for most
people:

a-b : hyphen
a - b : em dash (spaces between the hyphen and surrounding words
indicate that it's not a plain hyphen)
a --b-- c : strikethrough

Ben

@pmario
Copy link
Member Author

pmario commented Jun 13, 2012

I'm not sure about this:

a - b : em dash (spaces between the hyphen and surrounding words

because if what do I need to do, if I exactly have to write "a - b" including the spaces and a hyphen not a em dash.

@pmario
Copy link
Member Author

pmario commented Jun 13, 2012

I just thought, I'm crazy to start this topic (again) but having a look at the media wiki sites [1][2] they have even more possibilities that make sense. So it's not a waste of time.

TeX [3] uses -- ndash and --- mdash. It would fit to $$$ for the typed blocks [4]

[1] http://en.wikipedia.org/wiki/MOS:DASH#Dashes
[2] http://en.wikipedia.org/wiki/Template:Spaced_mdash
[3] http://en.wikipedia.org/wiki/Dash
[4] #12 (comment)

@FND
Copy link
Contributor

FND commented Jun 14, 2012

I agree with cdent that mdash (--) should be sufficient.

FWIW, GitHub Flavored Markdown uses wavy ~~tildes~~ for strikethrough, which I think is less prone to creating confusion.

@Jermolene
Copy link
Member

Sorry for the delay. I've just committed a revised emphasis parser rule that uses ~~tildes~~ for strikethrough, as per @FND's suggestion, and switches subscript to ,,commas,,. (The latter idea came from WikiMatrix that reports several wikis using this pattern).

https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/parsers/wikiparser/rules/run/emphasis.js

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

5 participants