summaryrefslogtreecommitdiff
path: root/source/features/format-conversation-titles.tsx
blob: 876f027d92609633558e43b5d7086bc2f4cec4a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import select from 'select-dom';
import * as pageDetect from 'github-url-detection';

import features from '.';
import observeElement from '../helpers/simplified-element-observer';
import * as domFormatters from '../github-helpers/dom-formatters';

function init(): void {
	for (const title of select.all('.js-issue-title')) {
		if (!select.exists('a, code', title)) {
			domFormatters.linkifyIssues(title);
			domFormatters.parseBackticks(title);
		}
	}
}

void features.add(__filebasename, {
	include: [
		pageDetect.isPR,
		pageDetect.isIssue
	],
	init() {
		observeElement(select('#partial-discussion-header')!.parentElement!, init, {
			subtree: true,
			childList: true
		});
	}
});