/**
 * Removes `\n` and `\t` characters after opening tags (before text content).
 *
 * Transforms patterns like `>[\n\t]+(text)` to `>(text)`.
 *
 * Examples:
 * - `<p>\n\tHello` → `<p>Hello`
 * - `<div>\n\n\tWorld` → `<div>World`
 */
export class RemoveWhitespaceAfterOpeningTagProcessor {
  /**
   * Process the HTML string to remove `\n` and `\t` after opening tags.
   *
   * @param {string} html - The HTML string to process.
   * @returns {string} The processed HTML string.
   */
  process(html) {
    // Pattern: `>[\n\t]+(text)` → `>(text)`
    return html.replace(/(>)[\n\t]+(?=.)/g, '$1');
  }
}
