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

Markdown strikethrough support #130

Open
yyoon opened this issue Nov 26, 2015 · 2 comments
Open

Markdown strikethrough support #130

yyoon opened this issue Nov 26, 2015 · 2 comments

Comments

@yyoon
Copy link
Owner

yyoon commented Nov 26, 2015

Continuation of #124, as the strikethrough support was not implemented there.

@crxtrdude
Copy link
Contributor

I'll repost this as reference:

I understand why you did that, but I still think it was incorrect for a few reasons.

First, it wouldn't necessarily match the opening / closing strikethrough mark pairs.
Take the following example.

~~Line1
Line2
Line3

GitHub renders it as:

~~Line1
Line2
Line3

, because there is no closing ~~ mark at the end.

However, the current code seems like it would just add the opening <del> and then never close it.
Processing the opening / closing mark separately will cause all sorts of this problems.

Second, it seems to me that it would only handle the ~~ marks that appear right after <p>and right before </p> am I right? This may not be able to handle the following case:

Normal text ~~strikethrough
should be applied here~~ and not here.
GitHub renders it as:

Normal text strikethrough
should be applied here
and not here.

, but I think our previous code would probably not handle this correctly.

These are the reasons why I suggested to process at the paragraph level, not at the line level.

Therefore the code here needs to be:

  • Satisfies inline strikethrough with newlines, while ...
  • Checks the entire paragraph to see if it's terminated or not.
  • Checks if there are no spaces for the strkethroughs before parsing them as <del> tags.

@crxtrdude
Copy link
Contributor

I need to find a way to do so, is there a more systematic way of doing it without using regex or something? The reason I don't want to use a Regex for now is that it's more flexible to accomplish this, and it can fulfill more than just the single lined ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants