Option to set controls attribute for MediaLinks

This commit is contained in:
Luke
2022-10-13 15:01:51 +01:00
parent 98c687b4ed
commit e155792be5
2 changed files with 7 additions and 1 deletions

View File

@@ -110,7 +110,10 @@ namespace Markdig.Extensions.MediaLinks
{
htmlAttributes.AddPropertyIfNotExist("height", Options.Height);
}
htmlAttributes.AddPropertyIfNotExist("controls", null);
if (Options.Controls)
{
htmlAttributes.AddPropertyIfNotExist("controls", null);
}
if (!string.IsNullOrEmpty(Options.Class))
htmlAttributes.AddClass(Options.Class);

View File

@@ -16,6 +16,7 @@ namespace Markdig.Extensions.MediaLinks
{
Width = "500";
Height = "281";
Controls = true;
Class = "";
ExtensionToMimeType = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
@@ -90,6 +91,8 @@ namespace Markdig.Extensions.MediaLinks
public string Height { get; set; }
public bool Controls { get; set; }
public string Class { get; set; }
public Dictionary<string, string> ExtensionToMimeType { get; }