Snapd.MarkdownParser

g GObject.Object GObject.Object Snapd.MarkdownParser Snapd.MarkdownParser GObject.Object->Snapd.MarkdownParser

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (version)

get_preserve_whitespace ()

parse (text)

set_preserve_whitespace (preserve_whitespace)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Snapd.MarkdownParser(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Snapd.MarkdownParserClass

Snapd.MarkdownParser is an opaque data structure and can only be accessed using the provided functions.

New in version 1.48.

classmethod new(version)
Parameters:

version (Snapd.MarkdownVersion) – version supported by the client.

Returns:

a new Snapd.MarkdownParser

Return type:

Snapd.MarkdownParser

Create an object to parse markdown text.

New in version 1.48.

get_preserve_whitespace()
Returns:

True if paragraph whitespace is preserved.

Return type:

bool

Check if paragraph whitespace will be kept intact.

New in version 1.48.

parse(text)
Parameters:

text (str) – text to parse.

Returns:

Text split into blocks.

Return type:

[Snapd.MarkdownNode]

Convert text in snapd markdown format to markup.

New in version 1.48.

set_preserve_whitespace(preserve_whitespace)
Parameters:

preserve_whitespace (bool) – True if the parse should keep paragraph whitespace intact.

Consecutive paragraph whitespace (space, tabs, newlines) is automatically combined into a single space character. This renders the paragraphs in the form that HTML uses. If you need the original whitespace that the markdown author wrote then set this to False.

New in version 1.48.