From fbd5eeb993b4a934b6cb2598adbb67485e74f16b Mon Sep 17 00:00:00 2001 From: SavagePeanut Date: Sun, 3 Sep 2023 21:27:07 -0500 Subject: add test case --- src/matrix.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/matrix.rs b/src/matrix.rs index 92d2eb8..963e569 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -46,7 +46,7 @@ pub fn format_for_matrix(body: String) -> PyResult { if tag == "" { // index is at \n, add 1 to skip that one let substring = chars[index + 1..replace_newlines_to].into_iter().collect::(); - chars = [&chars[..index + 1], &substring.replace('\n', "
").chars().collect::>()[..]].concat(); + chars = [&chars[..index + 1], &substring.replace('\n', "
").chars().collect::>()[..], &chars[replace_newlines_to..]].concat(); } else if tag == "
" {
             replace_newlines_to = index;
         }
@@ -60,6 +60,7 @@ pub fn format_for_matrix(body: String) -> PyResult {
         } else {
             replace_newlines_to - offset.abs() as usize
         };
+        println!("chars {:?}", chars.clone().into_iter().collect::());
     }
     let substring = chars[..replace_newlines_to].into_iter().collect::();
     let text = [substring.replace('\n', "
"), chars[replace_newlines_to..].into_iter().collect::()].concat(); -- cgit v1.2.3