fix(code): 修复标题显示错误问题

This commit is contained in:
nineya 2023-03-28 14:22:23 +08:00
parent 9d5bc74ff6
commit 81f4089fd4

View File

@ -20,7 +20,7 @@ const postContext = {
num = str2.index num = str2.index
if (str1) { if (str1) {
if (str1[1].endsWith(str2[0])) { if (str1[1].endsWith(str2[0])) {
str1[1] = str1[1].substring(0, str2[0].length) str1[1] = str1[1].substring(0, str1[1].length - str2[0].length)
} }
} else { } else {
title = clazz.substring(9, str2.index) title = clazz.substring(9, str2.index)
@ -35,6 +35,7 @@ const postContext = {
title = str1[1] title = str1[1]
} }
$(this).attr('class', clazz.substring(0, num)) $(this).attr('class', clazz.substring(0, num))
if (!title) title = clazz.substring(9, num)
} else { } else {
title = clazz.substring(9) title = clazz.substring(9)
} }