 indentLevel - 1);
        }

        // Add the indented line
        result.push(indentChar.repeat(indentLevel) + line);

        // Check if we need to increase indent for next line
        if (line.startsWith('<') && !line.startsWith('</') && !line.endsWith('/>')) {
          // Check if it's a self-closing tag
          const tagMatch = line.match(/<(\w+)/);
          if (tagMatch) {
            const tagName = tagMatch[1].toLowerCase();
            const selfClosingTags = ['area', 'base', 'br', 'col',