feat: 首页评论修复html样式

This commit is contained in:
caiyuchao
2025-09-11 17:11:40 +08:00
parent 85b3b2d471
commit 8c5c7dde57
2 changed files with 11 additions and 5 deletions

View File

@@ -93,11 +93,14 @@ onMounted(async () => {
if (dataContent) {
const position = dataContent.indexOf('>') + 1;
const originalString = dataContent;
const stringToInsert = `<span style="font-size: 12px; color: #32363973">${item.author}</span>`;
const stringToInsert = `<span style="font-size: 14px; color: #32363973">${item.author}</span>`;
dataContent =
originalString.slice(0, position) +
stringToInsert +
originalString.slice(position);
originalString.startsWith('<p>') || originalString.startsWith('<h')
? originalString.slice(0, position) +
stringToInsert +
originalString.slice(position)
: stringToInsert + originalString;
}
return {