用户:RedDragon/Test2:修订间差异
来自Rizline中文维基
更多操作
小 |
小 |
||
| 第71行: | 第71行: | ||
}) | }) | ||
function parseSongsFromWikitext(wikitext) { | |||
const songs = [] | |||
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 matchCount = 0 | |||
while ((match = rowRegex.exec(wikitext)) !== null) { | |||
matchCount++ | |||
console.log(`匹配 ${matchCount}:`, match) | |||
const song = { | |||
image: match[1].trim(), | |||
title: match[2].trim(), | |||
author: match[3].trim(), | |||
duration: match[4].trim(), | |||
ez: match[5].trim(), | |||
hd: match[6].trim(), | |||
in: match[7].trim() | |||
} | |||
console.log('解析出的曲目:', song) | |||
if (song.title && song.title !== '' && song.title !== '?') { | |||
songs.push(song) | |||
} | } | ||
} | |||
console.log('解析出的所有曲目:', songs) | |||
console.log('总共匹配到:', matchCount, '个曲目') | |||
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