MarkdownLoadOptions class
MarkdownLoadOptions class
Allows to specify additional options when loading LoadFormat.MARKDOWN document into a Document object.
Inheritance: MarkdownLoadOptions → LoadOptions
Constructors
Name | Description |
---|---|
MarkdownLoadOptions() | Initializes a new instance of MarkdownLoadOptions class. |
Properties
Name | Description |
---|---|
base_uri | Gets or sets the string that will be used to resolve relative URIs found in the document into absolute URIs when required. Can be None or empty string. Default is None .(Inherited from LoadOptions) |
convert_metafiles_to_png | Gets or sets whether to convert metafile(Wmf or Emf) images to Png image format. (Inherited from LoadOptions) |
convert_shape_to_office_math | Gets or sets whether to convert shapes with EquationXML to Office Math objects. (Inherited from LoadOptions) |
encoding | Gets or sets the encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document. Can be None . Default is None .(Inherited from LoadOptions) |
font_settings | Allows to specify document font settings. (Inherited from LoadOptions) |
ignore_ole_data | Specifies whether to ignore the OLE data. (Inherited from LoadOptions) |
language_preferences | Gets language preferences that will be used when document is loading. (Inherited from LoadOptions) |
load_format | Specifies the format of the document to be loaded. Default is LoadFormat.AUTO. (Inherited from LoadOptions) |
msw_version | Allows to specify that the document loading process should match a specific MS Word version. Default value is MsWordVersion.WORD2019 (Inherited from LoadOptions) |
password | Gets or sets the password for opening an encrypted document. Can be None or empty string. Default is None .(Inherited from LoadOptions) |
preserve_empty_lines | Gets or sets a boolean value indicating whether to preserve empty lines while load a LoadFormat.MARKDOWN document. The default value is False . Normally, empty lines between block-level elements in Markdown are ignored. Empty lines at the beginning and end of the document are also ignored. This option allows to import such empty lines. |
preserve_include_picture_field | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is False .(Inherited from LoadOptions) |
progress_callback | Called during loading a document and accepts data about loading progress. (Inherited from LoadOptions) |
resource_loading_callback | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. (Inherited from LoadOptions) |
temp_folder | Allows to use temporary files when reading document. By default this property is None and no temporary files are used.(Inherited from LoadOptions) |
update_dirty_fields | Specifies whether to update the fields with the dirty attribute.(Inherited from LoadOptions) |
use_system_lcid | Gets or sets whether to use LCID value obtained from Windows registry to determine page setup default margins. (Inherited from LoadOptions) |
warning_callback | Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. (Inherited from LoadOptions) |
Examples
Shows how to preserve empty line while load a document.
md_text = f'{os.linesep}Line1{os.linesep}{os.linesep}Line2{os.linesep}{os.linesep}'
stream = io.BytesIO(str.encode(md_text))
stream.seek(0)
load_options = aw.loading.MarkdownLoadOptions()
load_options.preserve_empty_lines = True
doc = aw.Document(stream, load_options)
self.assertEqual('\rLine1\r\rLine2\r\x0c', doc.get_text())
See Also
- module aspose.words.loading
- class LoadOptions