2022-12-28 09:45:26 +03:00
|
|
|
export function createMarkup(text) {
|
2023-01-10 18:48:02 +03:00
|
|
|
return {__html: text.split('</p>').join('</p>')}
|
2022-12-28 09:45:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export function transformHtml(text) {
|
2023-01-10 18:48:02 +03:00
|
|
|
let startHtml = {__html: text.split('<h2>').join('<br><h2>').split('<br>')};
|
|
|
|
startHtml = startHtml.__html.filter((el) =>
|
|
|
|
el !== null && el !== "" || el === 0
|
|
|
|
);
|
|
|
|
const finalHtml = startHtml.map((item) =>
|
|
|
|
`<div class='experience__block'>
|
|
|
|
<div class="summary__sections__head">
|
|
|
|
<h3>Описание опыта работы</h3>
|
|
|
|
<button>Редактировать раздел</button>
|
|
|
|
</div>
|
|
|
|
<div class="experience__content">${item.split('<h3>')[0]}</div>
|
|
|
|
</div>`
|
|
|
|
);
|
|
|
|
return {__html: finalHtml.join('')}
|
2022-12-28 09:45:26 +03:00
|
|
|
}
|