Refined-github: `bug #1234` sometimes creates a link, sometimes doesn't

Created on 26 Jun 2020  路  5Comments  路  Source: sindresorhus/refined-github

in https://github.com/nim-lang/Nim/pull/14796/files bug #1235 (or issue #1235) does not create a link to the corresponding github issue;

image

in other cases it does: https://github.com/nim-lang/Nim/pull/14795/files

image

How do we make it always work?

enhancement under discussion

Most helpful comment

This is because of https://github.com/sindresorhus/refined-github/blob/master/source/features/linkify-code.tsx#L26-L28, only issue references that are inside "code comments" are linkified.

In this case, GitHub doesn't highlight rst diffs enough for us to tell if it is a comment we have to process or part of code that should be ignored.

@fregante, maybe we should also linkify issue references that are outside of comments. Is something stopping us from doing that?

All 5 comments

This is because of https://github.com/sindresorhus/refined-github/blob/master/source/features/linkify-code.tsx#L26-L28, only issue references that are inside "code comments" are linkified.

In this case, GitHub doesn't highlight rst diffs enough for us to tell if it is a comment we have to process or part of code that should be ignored.

@fregante, maybe we should also linkify issue references that are outside of comments. Is something stopping us from doing that?

I don鈥檛 think so. That鈥檚 a comment so our logic is correct: GitHub issues appear in comments.

This is more about GitHub not recognizing its a comment.

We don鈥檛 linkify issues numbers everywhere to avoid unnecessary processing since GitHub issues appear in comments.

can we have the option to linkify everywhere? at very least in diffed text? that's the whole reason I'd want to use this

that's the whole reason I'd want to use this

This feature is to linkify issue references inside _code comments_, where we can say if a particular part of code is a comment.

In this particular case where you have a nim code block inside an rst file, GitHub doesn't process that code block. This seems to also happen in md files too (example).

By your own example it _does_ work inside regular nim file diffs, as you expect it to.

I suggest asking on https://github.com/github/linguist or https://github.com/Varriount/NimLime to properly support nim code highlighting in other files. Those are the libraries GitHub uses

Was this page helpful?
0 / 5 - 0 ratings

Related issues

durka picture durka  路  3Comments

sompylasar picture sompylasar  路  3Comments

mareksuscak picture mareksuscak  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

MilesBHuff picture MilesBHuff  路  3Comments