remark-github
Advanced tools
Comparing version 9.0.0 to 9.0.1
@@ -11,4 +11,4 @@ 'use strict' | ||
function locateRepoReference(value, fromIndex) { | ||
var hash = value.indexOf('@', fromIndex) | ||
var issue = value.indexOf('#', fromIndex) | ||
var commitMarker = value.indexOf('@', fromIndex) | ||
var issueMarker = value.indexOf('#', fromIndex) | ||
var index | ||
@@ -18,8 +18,8 @@ var start | ||
if (hash === -1) { | ||
index = issue | ||
} else if (issue === -1) { | ||
index = hash | ||
if (commitMarker === -1) { | ||
index = issueMarker | ||
} else if (issueMarker === -1) { | ||
index = commitMarker | ||
} else { | ||
index = hash > issue ? issue : hash | ||
index = commitMarker > issueMarker ? issueMarker : commitMarker | ||
} | ||
@@ -30,3 +30,3 @@ | ||
if (start === -1) { | ||
return index | ||
return -1 | ||
} | ||
@@ -43,3 +43,3 @@ | ||
if (index < start && index >= fromIndex) { | ||
test = start === hash ? hexadecimal : decimal | ||
test = start === commitMarker ? hexadecimal : decimal | ||
@@ -46,0 +46,0 @@ if ( |
@@ -7,2 +7,3 @@ 'use strict' | ||
var abbr = require('../util/abbreviate') | ||
var repoCharacter = require('../util/repo-character') | ||
@@ -47,2 +48,7 @@ module.exports = hash | ||
// Exit if the character before this was a repo characters. | ||
if (repoCharacter(eat.file.contents.charCodeAt(eat.now().offset - 1))) { | ||
return | ||
} | ||
subvalue = value.slice(0, index) | ||
@@ -49,0 +55,0 @@ |
@@ -11,2 +11,3 @@ 'use strict' | ||
var usernameCharacter = require('../util/username-character') | ||
var repoCharacter = require('../util/repo-character') | ||
@@ -91,2 +92,7 @@ module.exports = repoReference | ||
// Exit if the character before this was a repo characters. | ||
if (repoCharacter(eat.file.contents.charCodeAt(eat.now().offset - 1))) { | ||
return | ||
} | ||
reference = value.slice(referenceStart, index) | ||
@@ -93,0 +99,0 @@ content = reference |
{ | ||
"name": "remark-github", | ||
"version": "9.0.0", | ||
"version": "9.0.1", | ||
"description": "remark plugin to autolink references like in GitHub issues, PRs, and comments", | ||
@@ -50,13 +50,13 @@ "license": "MIT", | ||
"prettier": "^2.0.0", | ||
"remark": "^11.0.0", | ||
"remark-cli": "^7.0.0", | ||
"remark-preset-wooorm": "^6.0.0", | ||
"tape": "^4.0.0", | ||
"remark": "^12.0.0", | ||
"remark-cli": "^8.0.0", | ||
"remark-preset-wooorm": "^7.0.0", | ||
"tape": "^5.0.0", | ||
"tinyify": "^2.0.0", | ||
"xo": "^0.28.0" | ||
"xo": "^0.32.0" | ||
}, | ||
"scripts": { | ||
"format": "remark *.md -qfo && prettier --write \"**/*.js\" && xo --fix", | ||
"format": "remark . -qfo --ignore-pattern test/ && prettier . --write && xo --fix", | ||
"build-bundle": "browserify . -s remarkGitHub > remark-github.js", | ||
"build-mangle": "browserify . -s remarkGitHub -p tinyify > remark-github.js", | ||
"build-mangle": "browserify . -s remarkGitHub -p tinyify > remark-github.min.js", | ||
"build": "npm run build-bundle && npm run build-mangle", | ||
@@ -85,2 +85,3 @@ "test-api": "node test", | ||
"rules": { | ||
"unicorn/prefer-optional-catch-binding": "off", | ||
"unicorn/prefer-includes": "off" | ||
@@ -87,0 +88,0 @@ }, |
@@ -107,5 +107,5 @@ # remark-github | ||
* Issues across forks: | ||
`remarkjs#1` → [remarkjs#1][user-issue] | ||
`remarkjs#1` → [remarkjs#1][issue] | ||
* Issues across projects: | ||
`remarkjs/remark-github#1` → [remarkjs/remark-github#1][project-issue] | ||
`remarkjs/remark-github#1` → [remarkjs/remark-github#1][issue] | ||
* At-mentions: | ||
@@ -121,2 +121,4 @@ `@wooorm` → [**@wooorm**][mention] | ||
`options`. | ||
The value of `repository` should be a URL to a GitHub repository, such as | ||
`'https://github.com/user/project.git'`, or only `'user/project'`. | ||
@@ -153,3 +155,3 @@ ###### Mentions | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-github/master.svg | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-github/main.svg | ||
@@ -184,7 +186,7 @@ [build]: https://travis-ci.org/remarkjs/remark-github | ||
[contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md | ||
[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md | ||
[support]: https://github.com/remarkjs/.github/blob/master/support.md | ||
[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md | ||
[coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md | ||
[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md | ||
@@ -203,6 +205,2 @@ [license]: license | ||
[user-issue]: https://github.com/remarkjs/remark-github/issues/1 | ||
[project-issue]: https://github.com/remarkjs/remark-github/issues/1 | ||
[mention]: https://github.com/wooorm | ||
@@ -209,0 +207,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29089
709
208