The Zuri Standard Library Zuri

Text and Markup

markdown.errors

import markdown.errors
Zuri

markdown lifts part of this module out to its own top level; each name below is shown with the path that reaches it. Anything still spelled markdown.errors.* needs import markdown.errors.

The errors that the markdown module raises.

Markdown syntax can't cause an error by itself. Every string is a valid document, and text that doesn't match any Markdown syntax is rendered as plain text. Errors come from the parts around the Markdown, such as front matter that isn't valid YAML.

Classes

MarkdownError

class markdown.MarkdownError < Error
Zuri

The base class of every error that this module raises.

  • printable — has a @to_string(), so echo and print() show something useful

Constructor

markdown.MarkdownError(message)
Zuri

Parameters

  • message (string)

MarkdownError.to_string()

markdown.MarkdownError.to_string()
Zuri

MetadataError

class markdown.MetadataError < MarkdownError
Zuri

Raised when front matter can't be read, because it isn't valid YAML or it isn't a mapping.

import markdown

catch {
  markdown.parse('---\n- a list\n---\n', { metadata: true })
} as error {
  echo error.message
}
Zuri
  • printable — has a @to_string(), so echo and print() show something useful

Fields

Field Type Description
line number The source line that the front matter starts on.

Constructor

markdown.MetadataError(message, line)
Zuri

Parameters

  • message (string)
  • line (?number)

2026, Richard Ore and Zuri contributors