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

Fix/em yo #1654

Closed
wants to merge 7 commits into from
Closed

Fix/em yo #1654

wants to merge 7 commits into from

Conversation

Scrum
Copy link
Contributor

@Scrum Scrum commented Apr 24, 2020

Description

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR)

Committer

In most cases, this should be a different person than the contributor.

  • Draft GitHub release notes have been updated.
  • CI is green (no forced merge required).
  • Merge PR

@vercel
Copy link

vercel bot commented Apr 24, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/markedjs/markedjs/2i2a4afnt
✅ Preview: https://markedjs-git-fork-scrum-fix-em-yo.markedjs.now.sh

@@ -2850,7 +2850,7 @@
},
{
"markdown": "a*\"foo\"*\n",
"html": "<p>a*&quot;foo&quot;*</p>\n",
"html": "<p>a<em>&quot;foo&quot;</em></p>\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the commonmark spec that should not change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These common mark tests are derived from the spec so they should not be changed unless a new version of the spec comes out.

If a spec is marked with shouldFail: true that means it is failing and needs to be fixed in marked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marked as shouldFail

@UziTech
Copy link
Member

UziTech commented Apr 27, 2020

Seems like this is moving backwards in spec compliance. Could you find a way to fix *"yo"* while not failing spec tests that were passing?

@Scrum
Copy link
Contributor Author

Scrum commented Apr 28, 2020

I don't really understand

  1. https://spec.commonmark.org/dingus/?text=*%22Yo%22* here it is clearly visible that he is working out correctly, I don't know where the error is

  2. I don't really understand the problem that needs to be solved so that the same value is handled differently

@UziTech
Copy link
Member

UziTech commented Apr 28, 2020

The problem is that https://spec.commonmark.org/dingus/?text=a*%22Yo%22* is not working correctly with this PR but it is working without this PR.

@UziTech
Copy link
Member

UziTech commented Apr 28, 2020

Can you find a way to make *"Yo"* = <em>"Yo"</em> work as well as a*"Yo"* = a*"Yo"*?

It will probably involve editing the inlineText tokenizer or the inline.text regex rule.

@Scrum
Copy link
Contributor Author

Scrum commented Apr 29, 2020

The problem is that https://spec.commonmark.org/dingus/?text=a*%22Yo%22* is not working correctly with this PR but it is working without this PR.

Screenshot 2020-04-29 at 09 08 58

Can you find a way to make "Yo" = "Yo" work as well as a*"Yo"* = a*"Yo"*?

To do this, just return the rule to the state of the master, but then this PR has no value

@UziTech
Copy link
Member

UziTech commented Apr 29, 2020

To do this, just return the rule to the state of the master, but then this PR has no value

*"Yo"* = <em>"Yo"</em> isn't working in master

@UziTech
Copy link
Member

UziTech commented Apr 29, 2020

marked('*"Yo"*') is supposed to output <em>"Yo"</em> which works with this PR but in master it outputs *"Yo"*

marked('a*"Yo"*') is supposed to output a*"Yo"* which works in master but not with this PR.

Can you update this PR to make both work with this PR?

@Scrum
Copy link
Contributor Author

Scrum commented Apr 29, 2020

no since it is one and the same marked('*"Yo"*') marked('a*"Yo"*') you see the difference here if you miss the symbol a ?

this solution will work for marked('*"Yo"*') => <em>"Yo"</em> but at the same time it breaks tests commonmark "a*\"foo\"*\n" => <em>"Yo"</em> instead of the expected result <p>a*&quot;foo&quot;*</p> or vice versa

@UziTech
Copy link
Member

UziTech commented Apr 29, 2020

It is definitely possible. You will have to change more than just the em regex to make it work.

I don't think this PR should be merged if it could break current spec compliant markdown.

@Scrum Scrum closed this Apr 30, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants