Strip ANSI escape sequences from Sphinx directive output
Fixes #11424. When IPython's Sphinx directive executes code blocks, stderr/stdout and tracebacks can contain raw ANSI escape sequences that appear as garbled text in HTML/PDF documentation output. This adds a regex-based ANSI stripping step to process_input in EmbeddedSphinxShell so escape codes are removed before output reaches the rendered documentation. Also adds unit tests for the stripping behavior.
D
damesei committed
3ea7aa6988811bf34ac7179d8eb18fe80291bc2b
Parent: 9b7d419
Committed by M Bussonnier <bussonniermatthias@gmail.com>
on 6/25/2026, 7:11:44 AM