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

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

来自Rizline中文维基
第71行: 第71行:
     })
     })


    function parseSongsFromWikitext(wikitext) {
function parseSongsFromWikitext(wikitext) {
        const songs = []
    const songs = []
        console.log('wikitext内容:', wikitext)
    console.log('wikitext内容:', wikitext)


     const rowRegex = /\|\s*\[\[文件:([^|\]\n]+)(?:\|[^]\n]*)?\]\]\s*\n\|\s*\[\[([^|\]\n]+)(?:\|[^]\n]*)?\]\]\s*\n\|\s*([^|\n]+)\s*\n\|\s*([^|\n]+)\s*\n\|\s*([^|\n]+)\s*\n\|\s*([^|\n]+)\s*\n\|\s*([^|\n]+)/g
    // 以"|-"为行起点匹配整个表格行
     const rowRegex = /\|-\s*\n\|\s*\[\[文件:([^|\]\n]+)(?:\|[^]\n]*)?\]\]\s*\n\|\s*\[\[([^|\]\n]+)(?:\|[^]\n]*)?\]\]\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
    let matchCount = 0


        while ((match = rowRegex.exec(wikitext)) !== null) {
    while ((match = rowRegex.exec(wikitext)) !== null) {
            matchCount++
        matchCount++
            console.log(`匹配 ${matchCount}:`, match)
        console.log(`匹配 ${matchCount}:`, match)


            const song = {
        const song = {
                image: match[1].trim(),
            image: match[1].trim(),
                title: match[2].trim(),
            title: match[2].trim(),
                author: match[3].trim(),
            author: match[3].trim(),
                duration: match[4].trim(),
            duration: match[4].trim(),
                ez: match[5].trim(),
            ez: match[5].trim(),
                hd: match[6].trim(),
            hd: match[6].trim(),
                in: match[7].trim()
            in: match[7].trim()
            }
        }


            console.log('解析出的曲目:', song)
        console.log('解析出的曲目:', song)


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


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


        return songs
    return songs
    }
}


     function loadSongColors(song) {
     function loadSongColors(song) {

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

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

神秘的随机挑战!


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

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