打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

用户:RedDragon/Test2:修订间差异

来自Rizline中文维基
第73行: 第73行:
     function parseSongsFromWikitext(wikitext) {
     function parseSongsFromWikitext(wikitext) {
         const songs = []
         const songs = []
         console.log('wikitext内容:', wikitext) // 调试用
         console.log('wikitext内容:', wikitext)


         const rowRegex = /\|\[\[文件:(.*?)\]\]\s*\n\|\|\[\[(.*?)\]\]\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*(?=\n\|-|\n\}|$)/g
         const rowRegex = /\|\s*\[\[文件:([^|\]]+)(?:\|[^]]*)?\]\]\s*\n\|\s*\[\[([^|\]]+)(?:\|[^]]*)?\]\]\s*\n\|\s*([^\n|]+)\s*\n\|\s*([^\n|]+)\s*\n\|\s*([^\n|]+)\s*\n\|\s*([^\n|]+)\s*\n\|\s*([^\n|]+)/g


         let match
         let match
        let matchCount = 0
         while ((match = rowRegex.exec(wikitext)) !== null) {
         while ((match = rowRegex.exec(wikitext)) !== null) {
             console.log('匹配到的数据:', match) // 调试用
            matchCount++
             console.log(`匹配 ${matchCount}:`, match)


             const song = {
             const song = {
第91行: 第94行:
             }
             }


             console.log('解析出的曲目:', song) // 调试用
             console.log('解析出的曲目:', song)


             if (song.title) {
             if (song.title) {
                 if (song.title !== '') {
                 if (song.title !== '') {
                     songs.push(song)
                     if (song.title !== '?') {
                        songs.push(song);
                    }
                 }
                 }
             }
             }
         }
         }


         console.log('解析出的所有曲目:', songs) // 调试用
         console.log('解析出的所有曲目:', songs)
        console.log('总共匹配到:', matchCount, '个曲目')
 
         return songs
         return songs
     }
     }

2025年10月19日 (日) 23:10的版本

曲目
限制
难度 a
流速 b
MOD c
其他 d

神秘的随机挑战!


曲目
限制
难度 a
流速 b
MOD c
其他 d

User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2