GithubHelp home page GithubHelp logo

Comments (10)

Jermolene avatar Jermolene commented on July 28, 2024

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?

from tiddlywiki5.

pmario avatar pmario commented on July 28, 2024

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

from tiddlywiki5.

Jermolene avatar Jermolene commented on July 28, 2024

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.

from tiddlywiki5.

cdent avatar cdent commented on July 28, 2024

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

from tiddlywiki5.

pmario avatar pmario commented on July 28, 2024

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

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

from tiddlywiki5.

bengillies avatar bengillies commented on July 28, 2024

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

from tiddlywiki5.

pmario avatar pmario commented on July 28, 2024

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.

from tiddlywiki5.

pmario avatar pmario commented on July 28, 2024

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)

from tiddlywiki5.

FND avatar FND commented on July 28, 2024

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.

from tiddlywiki5.

Jermolene avatar Jermolene commented on July 28, 2024

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

from tiddlywiki5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.