Class
MarkdownImportSettings

Controls how Markdown content is imported into a RadFlowDocument.

Definition

Namespace:Telerik.Windows.Documents.Flow.FormatProviders.Md

Assembly:Telerik.Windows.Documents.Flow.dll

Syntax:

cs-api-definition
public class MarkdownImportSettings

Inheritance: objectMarkdownImportSettings

Constructors

MarkdownImportSettings()

Declaration

cs-api-definition
public MarkdownImportSettings()

Properties

AllowLocalFileSystemImages

Gets or sets whether images referenced by file:// URLs are read from the local file system and embedded during import. Default is false (local file images are skipped and a warning is added).

Declaration

cs-api-definition
public bool AllowLocalFileSystemImages { get; set; }

Property Value

bool

Remarks

Only enable this when the source Markdown is trusted. Enabling this setting on a server that processes user-supplied documents would allow arbitrary local files to be read and embedded into the output document (CWE-22 Path Traversal / local file disclosure).

Encoding

Gets or sets the encoding used when reading the Markdown stream. Defaults to UTF-8.

Declaration

cs-api-definition
public Encoding Encoding { get; set; }

Property Value

Encoding

Exceptions

ArgumentNullException

Thrown when set to null.

MaxDataUriImageTotalBytes

Gets or sets the maximum cumulative number of decoded bytes that may be embedded from data URI images across the entire document. When the running total exceeds this limit, subsequent data URI images are skipped and a warning is added to Warnings. Default is 0 (no limit). Set to a positive value to guard against CWE-400 (Uncontrolled Resource Consumption) via large embedded image payloads.

Declaration

cs-api-definition
public long MaxDataUriImageTotalBytes { get; set; }

Property Value

long

MaxDocumentSizeBytes

Gets or sets the maximum number of bytes that may be read from the input stream. Documents that exceed this limit cause an InvalidOperationException to be thrown during import. Default is 52,428,800 (50 MB). Set to 0 to disable the check.

Declaration

cs-api-definition
public long MaxDocumentSizeBytes { get; set; }

Property Value

long

StyleSettings

Gets the style customization settings applied during import. Use this to override which styles are used for Markdown elements or to customize the visual properties of auto-created styles.

Declaration

cs-api-definition
public MarkdownImportStyleSettings StyleSettings { get; }

Property Value

MarkdownImportStyleSettings

Warnings

Gets the list of non-fatal warnings generated during the last import operation. This list is cleared and repopulated each time MarkdownFormatProvider imports a document. Typical entries describe images that could not be loaded.

Declaration

cs-api-definition
public IList<string> Warnings { get; }

Property Value

IList<string>

Remarks

Do not modify this list while an import is in progress.