GenericAttributesExtension Class
Extension that allows to attach HTML attributes to the previous Inline or current Block. This extension should be enabled last after enabling other extensions.
public class GenericAttributesExtension : IMarkdownExtensionSee also
- Implements
Constructors
| Name | Description |
|---|---|
| GenericAttributesExtension() |
GenericAttributesExtension()
GenericAttributesExtension.cspublic GenericAttributesExtension()No documentation is available.
Properties
| Name | Description |
|---|---|
| AttributeFilter | Gets or sets the predicate that decides whether an attribute parsed from the Markdown (other than the id and the classes) is written to the HTML. The default value is GenericAttributesExtension.IsSafeAttributeName. |
AttributeFilter
GenericAttributesExtension.csGets or sets the predicate that decides whether an attribute parsed from the Markdown (other than the id and the classes) is written to the HTML. The default value is GenericAttributesExtension.IsSafeAttributeName.
Property value
Methods
| Name | Description |
|---|---|
| IsSafeAttributeName(string) | Returns true for the attributes that only describe the content, such as title, lang, alt, colspan, target, role and aria-*: the general attributes that Meziantou.Framework.HtmlSanitizer allows, other than class. Other attributes are rejected, including event handlers, attributes that hold a URL, style, name, and the data-* and directive attributes that client-side frameworks execute. Use GenericAttributesExtension.AttributeFilter to allow more attributes when the Markdown is trusted. |
| Setup(MarkdownPipeline, IMarkdownRenderer) | Configures this extension for the specified pipeline stage. |
| Setup(MarkdownPipelineBuilder) | Configures this extension for the specified pipeline stage. |
IsSafeAttributeName(string)
GenericAttributesExtension.csReturns true for the attributes that only describe the content, such as title, lang, alt, colspan, target, role and aria-*: the general attributes that Meziantou.Framework.HtmlSanitizer allows, other than class. Other attributes are rejected, including event handlers, attributes that hold a URL, style, name, and the data-* and directive attributes that client-side frameworks execute. Use GenericAttributesExtension.AttributeFilter to allow more attributes when the Markdown is trusted.
Setup overloads
Setup(MarkdownPipeline, IMarkdownRenderer)
GenericAttributesExtension.csConfigures this extension for the specified pipeline stage.
public void Setup(MarkdownPipeline pipeline, IMarkdownRenderer renderer)Parameters
pipelineMarkdownPipelinerendererIMarkdownRenderer
Setup(MarkdownPipelineBuilder)
GenericAttributesExtension.csConfigures this extension for the specified pipeline stage.
public void Setup(MarkdownPipelineBuilder pipeline)Parameters
pipelineMarkdownPipelineBuilder