用户:RedDragon/Test2:修订间差异
来自Rizline中文维基
更多操作
小 |
小 |
||
| 第71行: | 第71行: | ||
}) | }) | ||
function parseSongsFromWikitext(wikitext) { | function parseSongsFromWikitext(wikitext) { | ||
const songs = [] | |||
console.log('wikitext内容:', wikitext) | |||
// 分割整个文本,按"|-"来分割每一行 | |||
const rows = wikitext.split('|-') | |||
console.log('分割出的行数:', rows.length) | |||
for (let i = 1; i < rows.length; i++) { // 从1开始跳过表头 | |||
const row = rows[i] | |||
console.log(`处理第 ${i} 行:`, row) | |||
// 按换行符分割每一列 | |||
const columns = row.split('\n').filter(col => col.trim().startsWith('|')) | |||
console.log(`第 ${i} 行列数:`, columns.length) | |||
if (columns.length >= 7) { | |||
// 提取各列数据 | |||
const imageMatch = columns[0].match(/\[\[文件:([^|\]]+)/) | |||
const titleMatch = columns[1].match(/\[\[([^|\]]+)/) | |||
if (imageMatch && titleMatch) { | |||
const song = { | |||
image: imageMatch[1].trim(), | |||
title: titleMatch[1].trim(), | |||
author: columns[2].replace(/^\|/, '').trim(), | |||
duration: columns[3].replace(/^\|/, '').trim(), | |||
ez: columns[4].replace(/^\|/, '').trim(), | |||
hd: columns[5].replace(/^\|/, '').trim(), | |||
in: columns[6].replace(/^\|/, '').trim() | |||
} | |||
console.log('解析出的曲目:', song) | |||
if (song.title) { | |||
if (song.title !== '') { | |||
if (song.title !== '?') { | |||
songs.push(song); | |||
} | |||
} | |||
} | } | ||
} | } | ||
| 第106行: | 第116行: | ||
} | } | ||
console.log('解析出的所有曲目:', songs) | |||
console.log('总共匹配到:', songs.length, '个曲目') | |||
return songs | |||
} | } | ||
function loadSongColors(song) { | function loadSongColors(song) { | ||
2025年10月19日 (日) 23:53的版本
| 曲目 | |
|---|---|
|
|
|
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
神秘的随机挑战!
| 曲目 | |
|---|---|
|
| |
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2