apps-script-utils 2.1.1 Help

convertMarkdownToRichText

function convertMarkdownToRichText(text: string, theme: Theme = {}): RichTextRun[];

Bold, italic, code and links are recognised and become runs carrying the style each one implies, ready to be written into a slide or a cell. A theme can change what those styles are — the font of a code run, say — without touching the text.

Parameters

Parameter

Type

Description

text

string

The Markdown to convert.

theme (optional) = {}

Theme

The styles each kind of run is given.

Returns

RichTextRun[] — the runs, in order, each with its text and its style.

Throws

Exception

Condition

IllegalArgumentException

no argument is passed.

InvalidStringException

the text is not a string. An empty string is accepted and gives an empty array.

Examples

In use

const runs = convertMarkdownToRichText("**bold** and `code`");

See also

Source

src/appsscript/slide/convertMarkdownToRichText.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.