substantially improved styling
This commit is contained in:
+6
-5
@@ -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(),
|
||||
};
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user