TRVMarkdownProperties.LoadOptions

<< Click to display table of contents >>

TRVMarkdownProperties.LoadOptions

Options for Markdown saving.

type // defined in RVStyle unit
  TRVMarkdownLoadOption = (

    rvmdloBasePathLinks,
    rvmdloCollapseWhitespace,
    rvmdloCollapseWhitespaceInCodeSpans,
    rvmdloEnforceListLevels,

    rvmdloKeepLineBreaks);
 
  TRVMarkdownLoadOptions = set of TRVMarkdownLoadOption;

(introduced in version 19)

Option

Meaning

rvmdloBasePathLinks

If included, a base path is added to hyperlink targets (if they are relative paths).

For images, a base path is added even if this option is not included (if image paths are relative paths)

rvmdloCollapseWhitespace

If included: replace all runs of whitespace characters (including spaces and tabs) by a single space (according the the Markdown specification).

This property is applied to all text except for code spans and code blocks (in code blocks, whitespaces are loaded as they are)

rvmdloCollapseWhitespaceInCodeSpans

If included: replace all runs of whitespace characters (including spaces and tabs) by a single space in code spans (according the the Markdown specification).

rvmdloEnforceListLevels

If included: keeping list nesting levels.

If included: keeping list type.

rvmdloKeepLineBreaks

Normally, double spaces or '\' at the end of lines in paragraph produce line breaks.

If this option is included, line breaks in Markdown paragraphs produce line breaks as well.

This option does not affect code spans (in code spans, line breaks are always replaced by spaces) and code blocks (in code blocks, line breaks always start new paragraphs)

About loading list levels from Markdown

In Markdown, lists have an HTML model: single-level lists that can be nested.

In TRichView (like in Microsoft Word), lists may have multiple levels but cannot be nested.

As a result, the following list cannot be loaded as it is (because it has different type of markers at the second level):

* itemA

  * itemAA

* itemB

  1. itemBA

 

If rvmdloEnforceListLevels is included, this list is loaded as:

itemA (level 1)

oitemAA (level 2)

itemB (level 1)

oitemBA (level 2)

This list can be saved back as:

* itemA

  * itemAA

* itemB

  * itemBA

 

If rvmdloEnforceListLevels is excluded, this list is loaded like the following list:

itemA (level 1)

oitemAA (level 2)

itemB (level 1)

1.itemBA (level 3) 

This list can be saved back as:

* itemA

  * itemAA

* itemB

  * 

    1. itemBA

Default value:

[rvmdloBasePathLinks, rvmdloCollapseWhitespace, rvmdloCollapseWhitespaceInCodeSpans, rvmdloEnforceListLevels]

 

See also

TRVRTFReaderProperties.BasePathLinks, TRVHTMLReaderProperties.BasePathLinks

TRVHTMLReaderProperties.EnforceListLevels