diff options
| author | SavagePeanut <sourcehut@lazytapir.com> | 2024-07-29 13:40:13 -0500 |
|---|---|---|
| committer | SavagePeanut <sourcehut@lazytapir.com> | 2024-07-29 13:40:13 -0500 |
| commit | e65a593a121935a245ef02b24d2b9464665c05f8 (patch) | |
| tree | 8ded01bd5c67a36276924fbb05b053b3a2e51685 | |
| parent | bc3419c54fc972381d23a43e7a2d88525b96e31e (diff) | |
don't replace newlines with <br> in matrix code blocks
| -rw-r--r-- | src/matrix.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/matrix.rs b/src/matrix.rs index cebddfd..0c359d1 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -52,7 +52,7 @@ pub fn format_for_matrix(body: String, mentions: Option<Vec<(String, usize, usiz // index is at \n, add 1 to skip that one let substring = chars[index + 1..replace_newlines_to].into_iter().collect::<String>(); chars = [&chars[..index + 1], &substring.replace('\n', "<br>").chars().collect::<Vec<char>>()[..], &chars[replace_newlines_to..]].concat(); - } else if tag == "<pre><code>" { + } else if tag.starts_with("<pre>") { replace_newlines_to = index; } |
