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

nested parentheses link #1414

Merged
merged 4 commits into from Feb 18, 2019

Conversation

@UziTech
Copy link
Member

commented Feb 7, 2019

Marked version: 0.6.0

Description

This is my proposed fix for #1405. It works with allowing multiple nested parentheses.

fixes #1405
closes #1408

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

Feder1co5oave and others added some commits Jan 13, 2019

Allow only ONE level of nested parenthesis in link uris (as previousl…
…y intended in 9f20c46). Reverts 9c976cd. Fixes #1405. Disable cm test 468.
@UziTech

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2019

I'd like to get opinions from @Feder1co5oave and @davisjam on this approach.

This was referenced Feb 14, 2019

@UziTech UziTech requested review from davisjam, joshbruce and styfle Feb 14, 2019

@UziTech UziTech changed the title [WIP] nested parentheses link nested parentheses link Feb 14, 2019

@UziTech

This comment has been minimized.

Copy link
Member Author

commented Feb 14, 2019

We should merge this soon and release a new version to fix https://snyk.io/vuln/SNYK-JS-MARKED-73637

@styfle

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

@UziTech Why is this PR still failing snyk? (I can't actually see the Details when I click it)

@styfle

styfle approved these changes Feb 15, 2019

@UziTech

This comment has been minimized.

Copy link
Member Author

commented Feb 15, 2019

The snyk check is failing because of https://snyk.io/vuln/SNYK-JS-MARKED-73637

maybe we should disable that check since it seems to be more of a false positive on most PRs.

@styfle

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

But enough people use snyk that its probably good to know when we are failing.

It sounds like the one thats failing is not related to this PR so I see why that's confusing.

@joshbruce
Copy link
Member

left a comment

I'm approving because I appreciate that this fixes a defect; however, before merging I would really like to know more about the Snyk thing (same with @styfle). I don't want to disable Snyk because they are widely, they've always done right by us, and it is the one area we said we would take very seriously.

@UziTech

This comment has been minimized.

Copy link
Member Author

commented Feb 16, 2019

The Snyk Github integration matches package version and dependencies to vulnerabilities in their database.

Since there is a vulnerability in the current version of marked, all new PRs will fail the Snyk check.

Marked doesn't have any regular dependencies so the only thing the Snyk check will tell us is if the current version of marked has a vulnerability or if there is a vulnerability in one of our dev dependencies (neither of which I think is especially helpful to check on every new PR)

@Feder1co5oave

This comment has been minimized.

Copy link
Contributor

commented Feb 16, 2019

Hi, this looks good to me, although I'm not sure escaping works as expected: can you verify inputs such as

[Text](uri\()
[Text](uri(\())
[Text](uri\\())

? Unfortunately I can't do it myself right now

@UziTech

This comment has been minimized.

Copy link
Member Author

commented Feb 16, 2019

demo

it looks like it works

@UziTech

This comment has been minimized.

Copy link
Member Author

commented Feb 16, 2019

If the function sees a \ it just skips the next character

@styfle

This comment has been minimized.

Copy link
Member

commented Feb 17, 2019

only thing the Snyk check will tell us is if the current version of marked has a vulnerability

Let’s remove the Snyk check on PRs (I think @joshbruce has to disable it)

Maybe we should add the badge to the README

https://snyk.io/test/npm/marked/badge.svg

@joshbruce

This comment has been minimized.

Copy link
Member

commented Feb 17, 2019

I'm fine with that - sound argument from @UziTech and good suggestion from @styfle.

Can we also double check a few things on the GitHub operations front?

You both are admins.

  1. You should have access to the settings tab + web hooks section. There you should be able to delete Snyk...could be wrong...just double checking.

  2. We also have WIP inside the integrations area. Are folks using it (are they even away of it)? If not, makes me question its value. Further GitHub released the idea of draft PRs that kinda offer the same protection; therefore, thinking we should default to native experience over integrating a package: https://help.github.com/articles/about-pull-requests/#draft-pull-requests

Thoughts and feedback, as always, welcome.

@Feder1co5oave

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

[demo](https://docs-8bxhez41v.now.sh/demo/?outputType=html&text=%5BText%5D(uri%5C()%0A%5BText%5D(uri(%5C())%0A%5BText%5D(uri%5C%5C())&options=&version=pr%3A1414)

it looks like it works

I just noticed that page automatically redirects to version=master!
Checking out locally, it really seems working:

[Text](uri\()
[Text](uri(\())
[Text](uri\\())
[Text](uri\)\))
[Text](uri\(\(())
^D

<p><a href="uri(">Text</a>
<a href="uri(()">Text</a>
<a href="uri%5C()">Text</a>
<a href="uri))">Text</a></p>
<p><a href="uri((()">Text</a></p>

@UziTech UziTech merged commit a908d08 into markedjs:master Feb 18, 2019

2 of 3 checks passed

security/snyk - package.json (markedjsbot) 1 vulnerable dependency path
Details
WIP Ready for review
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@UziTech UziTech referenced this pull request Feb 18, 2019
11 of 12 tasks complete

@UziTech UziTech deleted the UziTech:multi-bracket-link branch Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.