refactor(desktop): move markdown rendering to rust (#10000)

This commit is contained in:
Shoubhit Dash
2026-01-22 16:18:39 +05:30
committed by GitHub
parent 7b0ad87781
commit c737776958
9 changed files with 237 additions and 5 deletions

View File

@@ -0,0 +1,17 @@
use comrak::{markdown_to_html, Options};
pub fn parse_markdown(input: &str) -> String {
let mut options = Options::default();
options.extension.strikethrough = true;
options.extension.table = true;
options.extension.tasklist = true;
options.extension.autolink = true;
options.render.r#unsafe = true;
markdown_to_html(input, &options)
}
#[tauri::command]
pub async fn parse_markdown_command(markdown: String) -> Result<String, String> {
Ok(parse_markdown(&markdown))
}