Markdown
class Markdown
Constants
| protected ENCODED_CHARACTERS |
References that keep interpolated punctuation out of Markdown syntax. |
| protected DECODED_CHARACTERS |
Restore references left escaped in code or unchanged in raw HTML. Zero padding keeps ordinary entity examples and literal backslashes intact. Angle brackets remain escaped so restoration cannot introduce HTML tags. |
Properties
| protected string | $theme | The current theme being used when generating emails. |
|
| protected array | $componentPaths | The registered component paths. |
|
| static protected bool | $withSecuredEncoding | Indicates if secure encoding should be enabled. |
|
| static protected ExtensionInterface>> | $extensions | The registered CommonMark extensions. |
Methods
Render the Markdown template into HTML.
Render the Markdown template into text.
Get a Markdown converter instance.
Get the HTML component paths.
Get the text component paths.
Clone the view factory with render-local mail component paths.
Get the component paths.
Register new mail component paths.
Get the theme currently being used by the renderer.
Enable secured encoding when parsing Markdown.
Disable secured encoding when parsing Markdown.
Flush all static state.
Details
at line 77
__construct(Factory $view, array $options = [])
Create a new Markdown renderer instance.
at line 90
HtmlString
render(string $view, array $data = [], mixed $inliner = null, string|null $theme = null)
Render the Markdown template into HTML.
at line 138
HtmlString
renderText(string $view, array $data = [])
Render the Markdown template into text.
at line 152
static HtmlString
parse(Stringable|string $text, bool $encoded = false)
Parse the given Markdown text into HTML.
at line 179
static MarkdownConverter
converter(array $config = [])
| internal |
Get a Markdown converter instance.
at line 198
array
htmlComponentPaths()
Get the HTML component paths.
at line 208
array
textComponentPaths()
Get the text component paths.
at line 218
protected Factory
viewFactoryWithMailNamespace(array $paths)
Clone the view factory with render-local mail component paths.
at line 232
protected array
componentPaths()
Get the component paths.
at line 245
void
loadComponentsFrom(array $paths = [])
Register new mail component paths.
Mutates the shared Markdown renderer's component paths; use scoped view namespaces for per-render component path changes.
at line 259
Markdown
theme(string $theme)
Set the default theme to be used.
Mutates the shared Markdown renderer's default theme; pass a per-render theme to render() for message-specific themes.
at line 270
string
getTheme()
Get the theme currently being used by the renderer.
at line 281
static void
withSecuredEncoding()
Enable secured encoding when parsing Markdown.
The flag persists in a static property for the worker lifetime and applies to every subsequent Markdown render across all coroutines.
at line 293
static void
withoutSecuredEncoding()
Disable secured encoding when parsing Markdown.
The flag persists in a static property for the worker lifetime and applies to every subsequent Markdown render across all coroutines.
at line 302
static void
flushState()
Flush all static state.