Rearrange github link helpers

So that regex and transformation appear together.
This commit is contained in:
Hiro Asari 2014-01-11 13:42:34 -05:00
parent 9ed3e66206
commit 2b65686636

View File

@ -79,15 +79,18 @@ require 'config/emoij'
self._githubCommitReferenceLink(reference, { owner: owner, repo: repo }, { owner: matchedOwner, repo: matchedRepo, sha: matchedSHA })
text
_githubReferenceRegexp: new RegExp("([\\w-]+)?\\/?([\\w-]+)?(?:#|gh-)(\\d+)", 'g')
_githubReferenceLink: (reference, current, matched) ->
owner = matched.owner || current.owner
repo = matched.repo || current.repo
"<a href=\"http://github.com/#{owner}/#{repo}/issues/#{matched.number}\">#{reference}</a>"
_githubReferenceRegexp: new RegExp("([\\w-]+)?\\/?([\\w-]+)?(?:#|gh-)(\\d+)", 'g')
_githubUserRegexp: new RegExp("\\B@([\\w-]+)", 'g')
_githubUserLink: (reference, username) ->
"<a href=\"http://github.com/#{username}\">#{reference}</a>"
_githubCommitReferenceRegexp: new RegExp("([\\w-]+)?\\/([\\w-]+)?@([0-9A-Fa-f]+)", 'g')
_githubCommitReferenceLink: (reference, current, matched) ->
@ -95,9 +98,6 @@ require 'config/emoij'
repo = matched.repo || current.repo
"<a href=\"http://github.com/#{owner}/#{repo}/commit/#{matched.sha}\">#{reference}</a>"
_githubUserLink: (reference, username) ->
"<a href=\"http://github.com/#{username}\">#{reference}</a>"
_normalizeDateString: (string) ->
if window.JHW
string = string.replace('T', ' ').replace(/-/g, '/')