用户: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 = /\|\[\[文件:( | 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( | 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