chore:AI回答的文字只有网址是蓝色,其他回答是黑色的
This commit is contained in:
@@ -2147,11 +2147,14 @@ _handleStreamError(msg) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 5) 行内代码 / 加粗 / 斜体 / 删除线 (此时链接已抽离, 不会被误改)
|
// 5) 行内代码 / 加粗 / 斜体 / 删除线 (此时链接已抽离, 不会被误改)
|
||||||
|
// PR-FIX-AI-TEXT-COLOR (2026-09-24): AI 回答统一配色 —— 正文/标题/加粗/行内代码/引用/删除线
|
||||||
|
// 一律黑色(TEXT), 只有"网址/链接"是蓝色(LINK)。
|
||||||
|
// 之前行内代码是粉色(#d63384)、删除线是灰色(#999), 回答里颜色太杂。
|
||||||
t = t
|
t = t
|
||||||
.replace(/`([^`]+)`/g, '<code style="background:#f2f3f5;padding:2rpx 10rpx;border-radius:6rpx;font-size:24rpx;font-family:monospace;color:#d63384;">$1</code>')
|
.replace(/`([^`]+)`/g, '<code style="background:#f2f3f5;padding:2rpx 10rpx;border-radius:6rpx;font-size:24rpx;font-family:monospace;color:' + TEXT + ';">$1</code>')
|
||||||
.replace(/\*\*(.+?)\*\*/g, '<strong style="font-weight:700;color:' + TEXT + ';">$1</strong>')
|
.replace(/\*\*(.+?)\*\*/g, '<strong style="font-weight:700;color:' + TEXT + ';">$1</strong>')
|
||||||
.replace(/\*(.+?)\*/g, '<em style="font-style:italic;">$1</em>')
|
.replace(/\*(.+?)\*/g, '<em style="font-style:italic;color:' + TEXT + ';">$1</em>')
|
||||||
.replace(/~~(.+?)~~/g, '<del style="text-decoration:line-through;color:#999;">$1</del>')
|
.replace(/~~(.+?)~~/g, '<del style="text-decoration:line-through;color:' + TEXT + ';">$1</del>')
|
||||||
|
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
@@ -2169,7 +2172,7 @@ _handleStreamError(msg) {
|
|||||||
const safe = code.replace(/</g, '<').replace(/>/g, '>')
|
const safe = code.replace(/</g, '<').replace(/>/g, '>')
|
||||||
codeBlocks.push(
|
codeBlocks.push(
|
||||||
`<pre style="background:#f7f8fa;padding:20rpx;border-radius:8rpx;overflow-x:auto;font-size:24rpx;line-height:1.6;margin:12rpx 0;white-space:pre-wrap;">` +
|
`<pre style="background:#f7f8fa;padding:20rpx;border-radius:8rpx;overflow-x:auto;font-size:24rpx;line-height:1.6;margin:12rpx 0;white-space:pre-wrap;">` +
|
||||||
`<code style="background:transparent;padding:0;font-family:monospace;color:#333;font-size:24rpx;">${safe}</code></pre>`
|
`<code style="background:transparent;padding:0;font-family:monospace;color:${TEXT};font-size:24rpx;">${safe}</code></pre>`
|
||||||
)
|
)
|
||||||
return `%%CODEBLOCK_${idx}%%`
|
return `%%CODEBLOCK_${idx}%%`
|
||||||
})
|
})
|
||||||
@@ -2265,7 +2268,7 @@ _handleStreamError(msg) {
|
|||||||
const bqMatch = line.match(/^>\s?(.+)$/)
|
const bqMatch = line.match(/^>\s?(.+)$/)
|
||||||
if (bqMatch) {
|
if (bqMatch) {
|
||||||
flushBuf(); out.push(closeList())
|
flushBuf(); out.push(closeList())
|
||||||
out.push(`<blockquote style="border-left:4rpx solid #d0d7de;padding:8rpx 16rpx;margin:${BQ_MARGIN};background:#f6f8fa;color:#57606a;line-height:${BQ_LH};font-size:28rpx;border-radius:0 6rpx 6rpx 0;">${parseInline(bqMatch[1])}</blockquote>`)
|
out.push(`<blockquote style="border-left:4rpx solid #d0d7de;padding:8rpx 16rpx;margin:${BQ_MARGIN};background:#f6f8fa;color:${TEXT};line-height:${BQ_LH};font-size:28rpx;border-radius:0 6rpx 6rpx 0;">${parseInline(bqMatch[1])}</blockquote>`)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3660,16 +3663,18 @@ _handleStreamError(msg) {
|
|||||||
.markdown-body {
|
.markdown-body {
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: $color-text;
|
/* PR-FIX-AI-TEXT-COLOR (2026-09-24): 统一配色 —— 正文/加粗/斜体/代码全部黑色,
|
||||||
|
只有链接(a)是蓝色; 之前正文是灰蓝($color-text)、代码是蓝灰($color-primary) */
|
||||||
|
color: #1a1a1a;
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: $color-text;
|
color: #1a1a1a;
|
||||||
}
|
}
|
||||||
|
|
||||||
em {
|
em {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
color: $color-text-light;
|
color: #1a1a1a;
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
@@ -3678,17 +3683,18 @@ _handleStreamError(msg) {
|
|||||||
border-radius: $radius-sm;
|
border-radius: $radius-sm;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: $color-primary;
|
color: #1a1a1a;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: $color-primary;
|
/* 网址/链接: 蓝色 (与 parseMarkdown 里的 LINK 常量保持一致) */
|
||||||
|
color: #3a7afe;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
text-underline-offset: 4rpx;
|
text-underline-offset: 4rpx;
|
||||||
transition: color 0.2s ease;
|
transition: color 0.2s ease;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #5a7cb0;
|
color: #2b6cf0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user