diff options
author | 2021-03-23 13:46:52 -0400 | |
---|---|---|
committer | 2021-03-23 13:46:52 -0400 | |
commit | 356b6a6d2b14d0289c02490557354f0c1fcbbd65 (patch) | |
tree | 74423adc332037883969b3ca3aaf31df84cc07e0 /source/features/linkify-code.tsx | |
parent | 81da3b5844de3f39406b831e1116c111112d2944 (diff) | |
download | refined-github-356b6a6d2b14d0289c02490557354f0c1fcbbd65.tar.gz refined-github-356b6a6d2b14d0289c02490557354f0c1fcbbd65.tar.zst refined-github-356b6a6d2b14d0289c02490557354f0c1fcbbd65.zip |
Restore `rgh-linkify-features` and `linkify-code` in titles (#4136)
Diffstat (limited to 'source/features/linkify-code.tsx')
-rw-r--r-- | source/features/linkify-code.tsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/features/linkify-code.tsx b/source/features/linkify-code.tsx index 413a9938..31f295cc 100644 --- a/source/features/linkify-code.tsx +++ b/source/features/linkify-code.tsx @@ -4,8 +4,17 @@ import {observe} from 'selector-observer'; import * as pageDetect from 'github-url-detection'; import features from '.'; +import onConversationHeaderUpdate from '../github-events/on-conversation-header-update'; import {linkifiedURLClass, linkifyURLs, linkifyIssues} from '../github-helpers/dom-formatters'; +function initTitle(): void { + for (const title of select.all('.js-issue-title')) { + if (!select.exists('a', title)) { + linkifyIssues(title); + } + } +} + function init(): void { const selectors = [ '.js-blob-wrapper', @@ -42,4 +51,13 @@ void features.add(__filebasename, { pageDetect.isGist ], init: onetime(init) +}, { + include: [ + pageDetect.isPR, + pageDetect.isIssue + ], + additionalListeners: [ + onConversationHeaderUpdate + ], + init: initTitle }); |