Currently, lines wrap. Approach suggested by @tobiasdiez: https://github.com/sagemath/sage/pull/35719#issuecomment-1578001519 Such transformations can be done in `SagecodeTransform` https://github.com/sagemath/sage/blob/develop/src/sage_docbuild/conf.py#L911