Added auto links and media support to markdown

This commit is contained in:
Mia Rose Winter 2024-02-02 17:35:30 +01:00
parent ca1a5998c4
commit 736f261459
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -1,4 +1,5 @@
using Markdig; using Markdig;
using Markdig.Extensions.MediaLinks;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Wave.Data; using Wave.Data;
@ -12,6 +13,11 @@ public static class MarkdownUtilities {
.UseListExtras() .UseListExtras()
.UseSoftlineBreakAsHardlineBreak() .UseSoftlineBreakAsHardlineBreak()
.UseSmartyPants() .UseSmartyPants()
.UseAutoLinks()
.UseMediaLinks(new MediaOptions {
AddControlsProperty = true,
Class = "max-w-full"
})
.DisableHtml() .DisableHtml()
.Build(); .Build();
return Markdown.ToHtml(markdown, pipeline); return Markdown.ToHtml(markdown, pipeline);