File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,11 @@ export class GitHubEditCommentEnhancer implements CommentEnhancer<GitHubEditComm
2323 return null
2424 }
2525
26- // Only enhance textareas that are within the issue/PR body editing container
27- const bodyContainer = textarea . closest ( '.react-issue-body' )
28- if ( ! bodyContainer ) {
26+ // Only enhance textareas that are for editing issue/PR body
27+ const isIssueBodyEdit = textarea . closest ( '.react-issue-body' )
28+ const isPRBodyEdit = textarea . id ?. match ( / ^ i s s u e - \d + - b o d y $ / ) || textarea . name === 'pull_request[body]'
29+
30+ if ( ! isIssueBodyEdit && ! isPRBodyEdit ) {
2931 return null
3032 }
3133
Original file line number Diff line number Diff line change @@ -241,8 +241,15 @@ describe('github', () => {
241241 expect ( enhancements ( document , window ) ) . toMatchInlineSnapshot ( `
242242 [
243243 {
244- "for": "id=issue-3429313834-body name=pull_request[body] className=js-comment-field js-paste-markdown js-task-list-field js-quick-submit js-size-to-fit size-to-fit js-session-resumable CommentBox-input FormControl-textarea js-saved-reply-shortcut-comment-field focus-visible",
245- "spot": "NO_SPOT",
244+ "for": "id=issue-3429313834-body name=pull_request[body] className=js-comment-field js-paste-markdown js-task-list-field js-quick-submit js-size-to-fit size-to-fit js-session-resumable CommentBox-input FormControl-textarea js-saved-reply-shortcut-comment-field focus-visible overtype-input",
245+ "spot": {
246+ "type": "GH_EDIT_COMMENT",
247+ "unique_key": "github.com:diffplug/gitcasso:58:edit-body",
248+ },
249+ "title": "N/A",
250+ "upperDecoration": <span>
251+ N/A
252+ </span>,
246253 },
247254 {
248255 "for": "id=new_comment_field name=comment[body] className=js-comment-field js-paste-markdown js-task-list-field js-quick-submit FormControl-textarea CommentBox-input js-size-to-fit size-to-fit js-session-resumable js-saved-reply-shortcut-comment-field overtype-input",
You can’t perform that action at this time.
0 commit comments