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

Handle leading whitespace in diff line #410

Merged
merged 1 commit into from
Dec 7, 2017

Conversation

stefanbuck
Copy link
Member

@stefanbuck stefanbuck commented Dec 6, 2017

#409 introduced a bug that stopped OctoLinker from inserting links. On GitHub a diff line starts with a whitespace character if the line is not modified which the RegeEx doesn't take into account.

Before

screen shot 2017-12-06 at 23 44 30

After

screen shot 2017-12-06 at 23 43 48

Copy link
Member

@josephfrazier josephfrazier left a comment

Choose a reason for hiding this comment

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

Looks good to me, but maybe we should add some tests to make sure it doesn't break again in the future?

@@ -461,7 +461,7 @@ function fixturesIterator(fixturesList, next) {

function addModifiedLines(valid) {
const [text, expected] = valid[0];
const diffLines = [[`-${text}`, expected], [`+${text}`, expected]];
const diffLines = [[` -${text}`, expected], [` +${text}`, expected]];
Copy link
Member Author

Choose a reason for hiding this comment

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

@josephfrazier this small change is testing the new behaviour

@stefanbuck stefanbuck merged commit 18fac59 into OctoLinker:master Dec 7, 2017
@stefanbuck stefanbuck deleted the fix-regex branch December 7, 2017 06:59
@stefanbuck stefanbuck mentioned this pull request Dec 7, 2017
@stefanbuck stefanbuck mentioned this pull request Sep 30, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants