(line: &str)
| 625 | } |
| 626 | |
| 627 | fn apply_code_block_background(line: &str) -> String { |
| 628 | let trimmed = line.trim_end_matches('\n'); |
| 629 | let trailing_newline = if trimmed.len() == line.len() { |
| 630 | "" |
| 631 | } else { |
| 632 | "\n" |
| 633 | }; |
| 634 | let with_background = trimmed.replace("\u{1b}[0m", "\u{1b}[0;48;5;236m"); |
| 635 | format!("\u{1b}[48;5;236m{with_background}\u{1b}[0m{trailing_newline}") |
| 636 | } |
| 637 | |
| 638 | fn find_stream_safe_boundary(markdown: &str) -> Option<usize> { |
| 639 | let mut in_fence = false; |