Argument `x` contains a CSI SGR sequence with unknown substrings or a OSC hyperlink with unsupported parameters at index [3], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

[1] "A<span style='background-color: #BB00BB;'><B</span>"
[2] "<span style='background-color: #BB00BB;'>A>B</span>"
[3] "<span style='background-color: #BB00BB;'>AB</span>"

Warning in to_html_int(x = x, warn = warn, term.cap = term.cap, classes = classes,  :
  `x` contains unescaped HTML special character '<' at index [1] (see ?html_esc); you can use `warn=FALSE` to turn off these warnings.
Warning in to_html_int(x = x, warn = warn, term.cap = term.cap, classes = classes,  :
  Argument `x` contains a CSI SGR sequence with unknown substrings or a OSC hyperlink with unsupported parameters at index [2], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.
Warning in to_html_int(x = x, warn = warn, term.cap = term.cap, classes = classes,  :
  `x` contains unescaped HTML special character '>' at index [2] (see ?html_esc); you can use `warn=FALSE` to turn off these warnings.
Warning in to_html_int(x = x, warn = warn, term.cap = term.cap, classes = classes,  :
  Argument `x` contains a CSI SGR sequence with unknown substrings or a OSC hyperlink with unsupported parameters at index [3], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

f <- in_html(html, css = "span {background-color: #CCC;}", display = FALSE)

in_html(html, css = "span {background-color: #CCC;}", display = FALSE, 
    clean = TRUE)

<span style='color: #BBBB00; background-color: #0000BB;'>B</span>

[1] "<span style='color: #BBBB00;'>A</span>"                           
[2] "<span style='color: #BBBB00; background-color: #0000BB;'>B</span>"
[3] "<span style='color: #BBBB00;'>C</span>"                           
[4] "D"

<a href='https://w.z'><span style='color: #BBBB00; background-color: #0000BB;'>B</span></a>

[1] "<a href='https://w.z'><span style='color: #BBBB00;'>A</span></a>"                           
[2] "<a href='https://w.z'><span style='color: #BBBB00; background-color: #0000BB;'>B</span></a>"
[3] "<a href='https://w.z'><span style='color: #BBBB00;'>C</span></a>"                           
[4] "<a href='https://w.z'>D</a>"