Guide
Markdown
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’smd
/markdown
filters.gfm
— GitHub-flavored Markdowngfm-comment
— GitHub-flavored Markdown, with newlines converted to<br>
tags. (Useful for parsing comments as inline text)extra
— Markdown Extra, provided by Parsedown Extrayii-extra
— Markdown Extra, provided by Yii’s internal Markdown parser. (This flavor doesn’t fully implement the Markdown Extra spec, so using the Parsedown-poweredextra
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 syntaxinlineOnly
(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.