Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
546 additions
and
574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coverage/ | ||
remark-github.js | ||
remark-github.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
'use strict'; | ||
module.exports = require('./lib/index.js'); | ||
'use strict' | ||
module.exports = require('./lib') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = mention; | ||
module.exports = mention | ||
|
||
var repo = require('../util/repo-character'); | ||
var repo = require('../util/repo-character') | ||
|
||
/* Find a possible mention. */ | ||
function mention(value, fromIndex) { | ||
var index = value.indexOf('@', fromIndex); | ||
var index = value.indexOf('@', fromIndex) | ||
|
||
if (index !== -1 && repo(value.charCodeAt(index - 1))) { | ||
return mention(value, index + 1); | ||
return mention(value, index + 1) | ||
} | ||
|
||
return index; | ||
return index | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
module.exports = locateRepoReference; | ||
module.exports = locateRepoReference | ||
|
||
var hexadecimal = require('is-hexadecimal'); | ||
var decimal = require('is-decimal'); | ||
var repoCharacter = require('../util/repo-character'); | ||
var hexadecimal = require('is-hexadecimal') | ||
var decimal = require('is-decimal') | ||
var repoCharacter = require('../util/repo-character') | ||
|
||
/* Find a possible reference. */ | ||
function locateRepoReference(value, fromIndex) { | ||
var hash = value.indexOf('@', fromIndex); | ||
var issue = value.indexOf('#', fromIndex); | ||
var index; | ||
var start; | ||
var test; | ||
var hash = value.indexOf('@', fromIndex) | ||
var issue = value.indexOf('#', fromIndex) | ||
var index | ||
var start | ||
var test | ||
|
||
if (hash === -1) { | ||
index = issue; | ||
index = issue | ||
} else if (issue === -1) { | ||
index = hash; | ||
index = hash | ||
} else { | ||
index = (hash > issue ? issue : hash); | ||
index = hash > issue ? issue : hash | ||
} | ||
|
||
start = index; | ||
start = index | ||
|
||
if (start === -1) { | ||
return index; | ||
return index | ||
} | ||
|
||
while (index >= fromIndex) { | ||
if (!repoCharacter(value.charCodeAt(index - 1))) { | ||
break; | ||
break | ||
} | ||
|
||
index--; | ||
index-- | ||
} | ||
|
||
if (index < start && index >= fromIndex) { | ||
test = start === hash ? hexadecimal : decimal; | ||
test = start === hash ? hexadecimal : decimal | ||
|
||
if ( | ||
test(value.charCodeAt(start + 1)) && | ||
!repoCharacter(value.charCodeAt(index - 1)) | ||
) { | ||
return index; | ||
return index | ||
} | ||
} | ||
|
||
/* Find the next possible value. */ | ||
return locateRepoReference(value, start + 1); | ||
return locateRepoReference(value, start + 1) | ||
} |
Oops, something went wrong.