mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: resolve pull request meta (title without id)
This commit is contained in:
parent
fd3476c1fa
commit
5a687cb9f5
1 changed files with 9 additions and 6 deletions
|
|
@ -151,12 +151,15 @@ export function isInPullFilesPage() {
|
|||
}
|
||||
|
||||
export function getIssueTitle() {
|
||||
const title = $(
|
||||
[
|
||||
'.gh-header-title .markdown-title', // exclude issue ID from title
|
||||
'.gh-header-title',
|
||||
'[data-component="TitleArea"] [data-component="PH_Title"]', // PR new experience title
|
||||
].join(),
|
||||
const titleContainerSelectors = [
|
||||
'[data-component="TitleArea"] [data-component="PH_Title"]', // PR new experience title
|
||||
'.gh-header-title',
|
||||
]
|
||||
const title = (
|
||||
$(
|
||||
// exclude issue ID from title
|
||||
titleContainerSelectors.map(selector => `${selector} .markdown-title`).join(),
|
||||
) ?? $(titleContainerSelectors.join())
|
||||
)?.textContent
|
||||
return title?.trim().replace(/\n/g, '')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue