## Overflow when wrap adds a closing tag

Expanding SGR sequences to HTML will create string longer than INT_MAX at index [1]. Try again with smaller strings.

[1] "Expanding SGR sequences to HTML will create string longer than INT_MAX at index [1]. Try again with smaller strings."

(x <- sgr_to_html("\033[31m\033[42mhello", classes = TRUE))

Strings longer than INT_MAX not supported (length 5 at index 1).

[1] "Strings longer than INT_MAX not supported (length 5 at index 1)."

Internal Error: max allowed buffer size is INT_MAX + 1. (req: 6 vs lim: 5), in FANSI_esc_html.

[1] "Internal Error: max allowed buffer size is INT_MAX + 1. (req: 6 vs lim: 5), in FANSI_esc_html."

Escaping HTML special characters will create string longer than INT_MAX at index [1]. Try again with smaller strings.

[1] "Escaping HTML special characters will create string longer than INT_MAX at index [1]. Try again with smaller strings."

string <- paste0(rep("\a", 10), collapse = "")

index start stop error translated esc
1      1     1    1    C0      FALSE  \a
2      1     2    2    C0      FALSE  \a
3      1     3    3    C0      FALSE  \a
4      1     4    4    C0      FALSE  \a
5      1     5    5    C0      FALSE  \a
6      1     6    6    C0      FALSE  \a
7      1     7    7    C0      FALSE  \a
8      1     8    8    C0      FALSE  \a
9      1     9    9    C0      FALSE  \a
10     1    10   10    C0      FALSE  \a

There are more than INT_MAX unhandled sequences, returning first INT_MAX errors.

[1] "There are more than INT_MAX unhandled sequences, returning first INT_MAX errors."

index start stop error translated esc
1      1     1    1    C0      FALSE  \a
2      2     1    1    C0      FALSE  \a
3      2     2    2    C0      FALSE  \a
4      2     3    3    C0      FALSE  \a
5      2     4    4    C0      FALSE  \a
6      2     5    5    C0      FALSE  \a
7      2     6    6    C0      FALSE  \a
8      2     7    7    C0      FALSE  \a
9      2     8    8    C0      FALSE  \a
10     2     9    9    C0      FALSE  \a