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

Codespan newline #1652

Merged
merged 7 commits into from May 3, 2020
Merged

Codespan newline #1652

merged 7 commits into from May 3, 2020

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Apr 24, 2020

Marked version: v1.0.0

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/lyg9hnduu
✅ Preview: https://markedjs-git-fork-uzitech-codespan-newline.markedjs.now.sh

src = src.substring(token.raw.length);
tokens.push(token);
if (token.type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

DRY? Same code added in two places?

Copy link
Member Author

Choose a reason for hiding this comment

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

That code is not really related so they could change independently.

Copy link
Member Author

@UziTech UziTech Apr 29, 2020

Choose a reason for hiding this comment

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

I don't think we should combine that code into a function since it could change and need to be moved back anyway. This is one reason the best practice for DRY is to only combine code that needs to change together and only if it is in three or more places.

Rule of three

It states that two instances of similar code don't require refactoring, but when similar code is used three times, it should be extracted into a new procedure.

@styfle styfle merged commit 0a57e47 into markedjs:master May 3, 2020
@UziTech UziTech mentioned this pull request May 16, 2020
12 tasks
@UziTech UziTech deleted the codespan-newline branch June 17, 2020 17:54
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.

v1.0.0 newlines inside lists v1.0.0 does not respect multiline code spans in list items
3 participants