@@ -32,10 +32,10 @@ export async function defaultGetIssueFn(issueLink: string, githubToken?: string,
3232 issueState : issueJson . state ,
3333 status : "ok" ,
3434 owner : config . owner ,
35- repo : config . repo ,
35+ repo : config . repo ,
3636 reactions : issueJson . reactions ,
3737 } ;
38- } export async function defaultGetPermalinkFn ( permalink : string , githubToken ?: string , onError ?: ( err : unknown ) => void ) : Promise < GithubPermalinkDataResponse > {
38+ } export async function defaultGetPermalinkFn ( permalink : string , githubToken ?: string , onError ?: ( err : unknown ) => void ) : Promise < GithubPermalinkDataResponse > {
3939 const config = parseGithubPermalinkUrl ( permalink ) ;
4040
4141
@@ -61,7 +61,7 @@ export async function defaultGetIssueFn(issueLink: string, githubToken?: string,
6161 }
6262
6363 const [ contentJson , commitJson ] = await Promise . all ( [ contentResult . json ( ) , commitResult . json ( ) ] ) ;
64- const content = atob ( contentJson . content ) ;
64+ const content = decodeURIComponent ( escape ( atob ( contentJson . content ) ) ) ;
6565 const lines = content . split ( "\n" ) ;
6666
6767 return {
@@ -76,6 +76,9 @@ export async function defaultGetIssueFn(issueLink: string, githubToken?: string,
7676 status : "ok"
7777 } ;
7878}
79+
80+
81+
7982export function handleResponse ( response : Response ) : ErrorResponses {
8083 if ( response . status === 404 ) {
8184 return { status : "404" } ;
@@ -87,7 +90,7 @@ export function handleResponse(response: Response): ErrorResponses {
8790 } ;
8891 }
8992
90- if ( response . status === 401 ) {
93+ if ( response . status === 401 ) {
9194 return {
9295 status : "unauthorized"
9396 }
0 commit comments