Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (38 sloc) 2.71 KB
title type order
Markdown
guide
70

Wordsmith provides a full and multi-flavored suite of Markdown parsing functions:

Markdown flavors

The following "flavors" of Markdown are supported:

  • original — The default when using Craft's md/markdown filters.
  • gfmGitHub-flavored Markdown
  • gfm-commentGitHub-flavored Markdown, with newlines converted to <br> tags. (Useful for parsing comments as inline text)
  • extraMarkdown Extra, provided by Parsedown Extra
  • yii-extra — Markdown Extra, provided by Yii's internal Markdown parser. (This flavor doesn't fully implement the Markdown Extra spec, so using the Parsedown-powered extra flavor is recommended. This option is provided to parallel the functionality of using the "extra" flavor of Craft's built-in Markdown parser.)

Parsing Markdown

markdown

Parses text through Markdown.

  • flavor ('gfm') — Your desired flavor of Markdown syntax
  • inlineOnly (false) — Parse only inline elements (useful for one-line descriptions)

This function attempts to override Craft's built-in markdown filter, in order to provide the superior Parsedown-powered 'extra' flavor.

md

Alias for markdown.

This function attempts to override Craft's built-in md filter, in order to provide the superior Parsedown-powered 'extra' flavor.

parsedown

Alias for markdown(flavor='gfm').

  • inlineOnly (false) — Parse only inline elements (useful for one-line descriptions)

Provided so that Wordsmith can be a drop-in replacement for the Parsedown or Craft 3 Parsedown plugins.

parsedownExtra

Alias for markdown(flavor='extra').

  • inlineOnly (false) — Parse only inline elements (useful for one-line descriptions)

Provided so that Wordsmith can be a drop-in replacement for the Parsedown or Craft 3 Parsedown plugins.

pde

Alias for parsedownExtra

Provided so that Wordsmith can be a drop-in replacement for the Parsedown or Craft 3 Parsedown plugins.