MarkdownLoadOptions constructor

MarkdownLoadOptions()

Initializes a new instance of MarkdownLoadOptions class.

def __init__(self):
    ...

Remarks

Automatically sets LoadFormat to LoadFormat.MARKDOWN.

Examples

Shows how to preserve empty line while load a document.

md_text = f'{system_helper.environment.Environment.new_line()}Line1{system_helper.environment.Environment.new_line()}{system_helper.environment.Environment.new_line()}Line2{system_helper.environment.Environment.new_line()}{system_helper.environment.Environment.new_line()}'
with io.BytesIO(system_helper.text.Encoding.get_bytes(md_text, system_helper.text.Encoding.utf_8())) as stream:
    load_options = aw.loading.MarkdownLoadOptions()
    load_options.preserve_empty_lines = True
    doc = aw.Document(stream=stream, load_options=load_options)
    self.assertEqual('\rLine1\r\rLine2\r\x0c', doc.get_text())

See Also