@@ -97,7 +97,11 @@ const handler = async (req: Request, env: Env) => {
9797 } ) ( ) ;
9898
9999 const markdownBlock =
100- `## ${ getScoreSheetScore ( scoreSheet ) } by ${ markdownUser } \n` +
100+ "<details>\n" +
101+ `<summary>${ getScoreSheetScore (
102+ scoreSheet
103+ ) } by ${ markdownUser } </summary>\n` +
104+ "\n" +
101105 "|Combination|Score|Screenshot|\n" +
102106 "|--|--|--|\n" +
103107 categories
@@ -120,7 +124,9 @@ const handler = async (req: Request, env: Env) => {
120124 } "/>` +
121125 " |"
122126 )
123- . join ( "\n" ) ;
127+ . join ( "\n" ) +
128+ "\n" +
129+ "</details>" ;
124130
125131 const { entries, id } = await getLeaderboard ( env ) ;
126132
@@ -130,7 +136,7 @@ const handler = async (req: Request, env: Env) => {
130136 entries . push ( { score : getScoreSheetScore ( scoreSheet ) , block : markdownBlock } ) ;
131137 entries . sort ( ( a , b ) => b . score - a . score ) ;
132138
133- while ( entries . length > 6 ) entries . pop ( ) ;
139+ while ( entries . length > 10 ) entries . pop ( ) ;
134140
135141 await setLeaderboard ( env , id , entries ) ;
136142
@@ -171,7 +177,9 @@ const getLeaderboard = async (env: Env) => {
171177 const body = data . repository . issue . body as string ;
172178 const id = data . repository . issue . id as string ;
173179 const entries = [
174- ...body . matchAll ( / # # ( \d + ) [ ^ \n ] * \n ( \| [ ^ \n ] * \| \n ? ) { 3 , } / g) ,
180+ ...body . matchAll (
181+ / < d e t a i l s > \s * < s u m m a r y > ( \d + ) .* < \/ s u m m a r y > \n \n ( \| .* \| \n ) { 3 , } < \/ d e t a i l s > / g
182+ ) ,
175183 ] . map ( ( [ block , score ] ) => ( { block, score : + score } ) ) ;
176184
177185 return { entries, id } ;
0 commit comments