File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import hljs from 'highlight.js'
2+ import type { Options } from 'overtype'
23import OverType from 'overtype'
34import { oncePerRefresh } from '@/lib/once-per-refresh'
45
6+ export const commonGithubOptions : Options = {
7+ autoResize : true ,
8+ lineHeight : 'var(--text-body-lineHeight-medium, 1.4285)' ,
9+ padding : 'var(--base-size-16)' ,
10+ }
11+
512export function prepareGitHubHighlighter ( ) {
613 oncePerRefresh ( 'github-highlighter' , ( ) => {
714 OverType . setCodeHighlighter ( githubHighlighter )
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ import type React from 'react'
33import type { CommentEnhancer , CommentSpot , StrippedLocation } from '@/lib/enhancer'
44import { logger } from '@/lib/logger'
55import { modifyDOM } from '../modifyDOM'
6- import { commonGithubOptions } from './ghOptions'
7- import { prepareGitHubHighlighter } from './githubHighlighter'
6+ import { commonGithubOptions , prepareGitHubHighlighter } from './github-common'
87
98export interface GitHubEditCommentSpot extends CommentSpot {
109 type : 'GH_EDIT_COMMENT'
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import type React from 'react'
44import type { CommentEnhancer , CommentSpot , StrippedLocation } from '@/lib/enhancer'
55import { logger } from '@/lib/logger'
66import { modifyDOM } from '../modifyDOM'
7- import { commonGithubOptions } from './ghOptions'
8- import { prepareGitHubHighlighter } from './githubHighlighter'
7+ import { commonGithubOptions , prepareGitHubHighlighter } from './github-common'
98
109export interface GitHubIssueAddCommentSpot extends CommentSpot {
1110 type : 'GH_ISSUE_ADD_COMMENT'
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import OverType, { type OverTypeInstance } from 'overtype'
22import type { CommentEnhancer , CommentSpot , StrippedLocation } from '../../enhancer'
33import { logger } from '../../logger'
44import { modifyDOM } from '../modifyDOM'
5- import { commonGithubOptions } from './ghOptions'
6- import { prepareGitHubHighlighter } from './githubHighlighter'
5+ import { commonGithubOptions , prepareGitHubHighlighter } from './github-common'
76
87interface GitHubIssueNewCommentSpot extends CommentSpot {
98 type : 'GH_ISSUE_NEW_COMMENT'
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ import type React from 'react'
33import type { CommentEnhancer , CommentSpot , StrippedLocation } from '@/lib/enhancer'
44import { logger } from '@/lib/logger'
55import { modifyDOM } from '../modifyDOM'
6- import { commonGithubOptions } from './ghOptions'
7- import { prepareGitHubHighlighter } from './githubHighlighter'
6+ import { commonGithubOptions , prepareGitHubHighlighter } from './github-common'
87
98export interface GitHubPRAddCommentSpot extends CommentSpot {
109 type : 'GH_PR_ADD_COMMENT' // Override to narrow from string to specific union
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import OverType, { type OverTypeInstance } from 'overtype'
22import type { CommentEnhancer , CommentSpot , StrippedLocation } from '../../enhancer'
33import { logger } from '../../logger'
44import { modifyDOM } from '../modifyDOM'
5- import { commonGithubOptions } from './ghOptions'
6- import { prepareGitHubHighlighter } from './githubHighlighter'
5+ import { commonGithubOptions , prepareGitHubHighlighter } from './github-common'
76
87interface GitHubPRNewCommentSpot extends CommentSpot {
98 type : 'GH_PR_NEW_COMMENT'
You can’t perform that action at this time.
0 commit comments