gitscope
← rgit / Diff · 6c57fb1 → 6c57fb1
Changes 6c57fb1..6c57fb1
Patch commit
diff --git a/src/git.rs b/src/git.rs
index 27f4e05..22468b8 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -10,7 +10,7 @@ use std::{
use anyhow::{anyhow, Context, Result};
use axum::response::IntoResponse;
use bytes::{BufMut, Bytes, BytesMut};
-use comrak::{ComrakOptions, ComrakPlugins};
+use comrak::{ComrakPlugins, Options};
use git2::{
DiffFormat, DiffLineType, DiffOptions, DiffStatsFormat, Email, EmailCreateOptions, ObjectType,
Oid, Signature, TreeWalkResult,
@@ -433,7 +433,17 @@ fn parse_and_transform_markdown(s: &str, syntax_set: &SyntaxSet) -> String {
let highlighter = ComrakSyntectAdapter { syntax_set };
plugins.render.codefence_syntax_highlighter = Some(&highlighter);
- comrak::markdown_to_html_with_plugins(s, &ComrakOptions::default(), &plugins)
+ // enable gfm extensions
+ // https://github.github.com/gfm/
+ let mut options = Options::default();
+ options.extension.autolink = true;
+ options.extension.footnotes = true;
+ options.extension.strikethrough = true;
+ options.extension.table = true;
+ options.extension.tagfilter = true;
+ options.extension.tasklist = true;
+
+ comrak::markdown_to_html_with_plugins(s, &options, &plugins)
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]