用户:RedDragon/Test2:修订间差异
来自Rizline中文维基
更多操作
小 |
小 |
||
| 第73行: | 第73行: | ||
function parseSongsFromWikitext(wikitext) { | function parseSongsFromWikitext(wikitext) { | ||
const songs = [] | const songs = [] | ||
const rowRegex = /\|\[\[文件:(.*?)\]\]\s*\|\| | console.log('wikitext内容:', wikitext) // 调试用 | ||
const rowRegex = /\|\[\[文件:(.*?)\]\]\s*\n\|\|\[\[(.*?)\]\]\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*\n\|\|(.*?)\s*(?=\n\|-|\n\}|$)/g | |||
let match | let match | ||
while ((match = rowRegex.exec(wikitext)) !== null) { | while ((match = rowRegex.exec(wikitext)) !== null) { | ||
console.log('匹配到的数据:', match) // 调试用 | |||
const song = { | const song = { | ||
image: match[1], | image: match[1].trim(), | ||
title: match[2], | title: match[2].trim(), | ||
author: match[3], | author: match[3].trim(), | ||
duration: match[4], | duration: match[4].trim(), | ||
ez: match[5], | ez: match[5].trim(), | ||
hd: match[6], | hd: match[6].trim(), | ||
in: match[7] | in: match[7].trim() | ||
} | } | ||
console.log('解析出的曲目:', song) // 调试用 | |||
if (song.title) { | if (song.title) { | ||
if (song.title !== '') { | if (song.title !== '') { | ||
| 第92行: | 第99行: | ||
} | } | ||
} | } | ||
console.log('解析出的所有曲目:', songs) // 调试用 | |||
return songs | return songs | ||
} | } | ||
2025年10月19日 (日) 23:02的版本
| 曲目 | |
|---|---|
|
|
|
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
神秘的随机挑战!
| 曲目 | |
|---|---|
|
| |
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2