Рефакторинг

This commit is contained in:
Book Pauk
2020-11-14 23:43:22 +07:00
parent 084df35184
commit 459564cb2d
3 changed files with 11 additions and 7 deletions

View File

@@ -99,7 +99,7 @@ class ContentsPage extends Vue {
const prepareLabel = (title, bolder = false) => {
let titleParts = title.split('<p>');
const textParts = titleParts.filter(v => v).map(v => `<div>${v.replace(/(<([^>]+)>)/ig, '')}</div>`);
const textParts = titleParts.filter(v => v).map(v => `<div>${utils.removeHtmlTags(v)}</div>`);
if (bolder && textParts.length > 1)
textParts[0] = `<b>${textParts[0]}</b>`;
return textParts.join('');
@@ -109,7 +109,7 @@ class ContentsPage extends Vue {
const pc = parsed.contents;
const newpc = [];
//преобразуем не первые разделы body в title-subtitle
//преобразуем все, кроме первого, разделы body в title-subtitle
let curSubtitles = [];
let prevBodyIndex = -1;
for (let i = 0; i < pc.length; i++) {