substantially improved styling

This commit is contained in:
2024-09-28 17:34:59 -06:00
parent a7135fb96d
commit faf3cd3df7
2 changed files with 87 additions and 34 deletions
+6 -5
View File
@@ -550,10 +550,11 @@ fn accept_command(
match command {
Command::SendChat { markdown, channels } => {
use markdown::*;
let html_text = match tokenize(&markdown).as_slice() {
block @ [Block::Paragraph(par)] => match par.as_slice() {
[Span::Text(par)] => par.to_string(),
_ => generate_markdown(block.to_vec())
let blocks = tokenize(&markdown);
let html_text = match blocks.as_slice() {
[Block::Paragraph(par)] => match par.as_slice() {
[Span::Text(text)] => text.to_string(),
_ => to_html(&markdown)
.trim()
.strip_prefix("<p>")
.unwrap()
@@ -561,7 +562,7 @@ fn accept_command(
.unwrap()
.to_string(),
},
block => generate_markdown(block.to_vec()).trim().to_string(),
_ => to_html(&markdown).trim().to_string(),
};
{