MediaLinkExtensions: Controls #572

Closed
opened 2026-01-29 14:40:04 +00:00 by claunia · 1 comment
Owner

Originally created by @LukeTOBrien on GitHub (Oct 13, 2022).

Hello,

I am creating a Static Website Generator and as one of my test I was creating a site with a video background, so this video has attributes muted, loop and autoplay but I do not want the controls attribute.
In MediaLinkExtension.cs line 113 there is code that adds the controls attribute but they is no way to say that I do not want this attribute to be added.
Do you think a boolean flag could be added to MediaOptions so that I can spefify that the attribute should not be added?

if (Options.Controls)
{
    htmlAttributes.AddPropertyIfNotExist("controls", null);
}

Thanks,

Luke

Originally created by @LukeTOBrien on GitHub (Oct 13, 2022). Hello, I am creating a Static Website Generator and as one of my test I was creating a site with a video background, so this video has attributes `muted`, `loop` and `autoplay` but I do not want the `controls` attribute. In [MediaLinkExtension.cs line 113](https://github.com/xoofx/markdig/blob/98c687b4ed8b7a7004837948fe18dcb8013528f7/src/Markdig/Extensions/MediaLinks/MediaLinkExtension.cs#L113) there is code that adds the `controls` attribute but they is no way to say that I do not want this attribute to be added. Do you think a boolean flag could be added to `MediaOptions` so that I can spefify that the attribute should not be added? ```cs if (Options.Controls) { htmlAttributes.AddPropertyIfNotExist("controls", null); } ``` Thanks, Luke
claunia added the enhancement label 2026-01-29 14:40:04 +00:00
Author
Owner

@xoofx commented on GitHub (Oct 13, 2022):

Do you think a boolean flag could be added to MediaOptions so that I can spefify that the attribute should not be added?

Yeah, completely, PR welcome.

@xoofx commented on GitHub (Oct 13, 2022): > Do you think a boolean flag could be added to MediaOptions so that I can spefify that the attribute should not be added? Yeah, completely, PR welcome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#572