roles-editor
Some checks failed
Deploy on push / deploy (push) Failing after 4s

This commit is contained in:
2025-07-25 09:58:34 +03:00
parent 5ef1944504
commit ac4d6799c8
3 changed files with 73 additions and 40 deletions

View File

@@ -355,13 +355,14 @@ const HTMLEditor = (props: HTMLEditorProps) => {
if (token.startsWith('</')) {
// Закрывающий тег - уменьшаем отступ
indent--
formatted += indentStr.repeat(Math.max(0, indent)) + token + '\n'
formatted += `${indentStr.repeat(Math.max(0, indent))}${token}\n`
} else if (token.startsWith('<') && token.endsWith('>')) {
// Открывающий тег
const isSelfClosing = token.endsWith('/>') ||
const isSelfClosing =
token.endsWith('/>') ||
/^<(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)(\s|>)/i.test(token)
formatted += indentStr.repeat(indent) + token + '\n'
formatted += `${indentStr.repeat(indent)}${token}\n`
if (!isSelfClosing) {
indent++
@@ -369,7 +370,7 @@ const HTMLEditor = (props: HTMLEditorProps) => {
} else {
// Текстовое содержимое
if (token.length > 0) {
formatted += indentStr.repeat(indent) + token + '\n'
formatted += `${indentStr.repeat(indent)}${token}\n`
}
}
}