125续15l-9:修esc未定义(admin改escAdmHtml/player改escapeHtml)+成书语义分页
This commit is contained in:
+4
-4
@@ -1305,13 +1305,13 @@ if ($currentVersion !== $BUILD_VERSION) {
|
||||
// 渲染:用 <pre-wrap> 原文 + 简单 markdown 转 html(标题/列表/加粗),不引入外部依赖
|
||||
el.innerHTML = `<div class="card" style="max-width:760px">
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:8px">
|
||||
<h2 style="margin:0">📜 ${esc(d.title || '服务器用户协议')}</h2>
|
||||
<h2 style="margin:0">📜 ${escapeHtml(d.title || '服务器用户协议')}</h2>
|
||||
<button class="btn btn-dim" onclick="renderRules(document.getElementById('content'))" style="font-size:12px;padding:6px 12px">🔄 刷新</button>
|
||||
</div>
|
||||
<div class="rules-body" style="line-height:1.85;font-size:14px;white-space:pre-wrap;word-break:break-word;color:var(--text)">
|
||||
${renderMarkdownLite(d.content)}
|
||||
</div>
|
||||
<p style="color:var(--dim);font-size:12px;margin-top:16px">协议版本指纹:${esc(d.fingerprint || '')} | 共 ${d.line_count || 0} 行</p>
|
||||
<p style="color:var(--dim);font-size:12px;margin-top:16px">协议版本指纹:${escapeHtml(d.fingerprint || '')} | 共 ${d.line_count || 0} 行</p>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
@@ -1334,7 +1334,7 @@ if ($currentVersion !== $BUILD_VERSION) {
|
||||
const lvl = s.match(/^#+/)[0].length;
|
||||
const txt = s.replace(/^#+\s*/, '');
|
||||
const sz = Math.max(15, 22 - lvl);
|
||||
html += `<div style="font-size:${sz}px;font-weight:700;color:var(--accent);margin:14px 0 8px">${esc(txt)}</div>`;
|
||||
html += `<div style="font-size:${sz}px;font-weight:700;color:var(--accent);margin:14px 0 8px">${escapeHtml(txt)}</div>`;
|
||||
continue;
|
||||
}
|
||||
// 无序列表
|
||||
@@ -1361,7 +1361,7 @@ if ($currentVersion !== $BUILD_VERSION) {
|
||||
|
||||
// 行内 markdown:加粗/斜体/代码/链接
|
||||
function inlineMd(s) {
|
||||
let t = esc(s);
|
||||
let t = escapeHtml(s);
|
||||
t = t.replace(/`([^`]*)`/g, '<code style="background:rgba(136,136,136,0.2);padding:1px 5px;border-radius:3px;font-size:0.9em">$1</code>');
|
||||
t = t.replace(/(\*\*|__)(.+?)\1/g, '<b>$2</b>');
|
||||
t = t.replace(/(^|[^*])(\*)([^*]+)\*(?!\*)/g, '$1<i>$3</i>');
|
||||
|
||||
Reference in New Issue
Block a user