REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 4.56 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php
Text
Base64
<?php namespace Illuminate\Mail; use Illuminate\Contracts\View\Factory as ViewFactory; use Illuminate\Support\HtmlString; use Illuminate\Support\Str; use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use League\CommonMark\Extension\Table\TableExtension; use League\CommonMark\MarkdownConverter; use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles; class Markdown { /** * The view factory implementation. * * @var \Illuminate\Contracts\View\Factory */ protected $view; /** * The current theme being used when generating emails. * * @var string */ protected $theme = 'default'; /** * The registered component paths. * * @var array */ protected $componentPaths = []; /** * Create a new Markdown renderer instance. * * @param \Illuminate\Contracts\View\Factory $view * @param array $options * @return void */ public function __construct(ViewFactory $view, array $options = []) { $this->view = $view; $this->theme = $options['theme'] ?? 'default'; $this->loadComponentsFrom($options['paths'] ?? []); } /** * Render the Markdown template into HTML. * * @param string $view * @param array $data * @param \TijsVerkoyen\CssToInlineStyles\CssToInlineStyles|null $inliner * @return \Illuminate\Support\HtmlString */ public function render($view, array $data = [], $inliner = null) { $this->view->flushFinderCache(); $contents = $this->view->replaceNamespace( 'mail', $this->htmlComponentPaths() )->make($view, $data)->render(); if ($this->view->exists($customTheme = Str::start($this->theme, 'mail.'))) { $theme = $customTheme; } else { $theme = str_contains($this->theme, '::') ? $this->theme : 'mail::themes.'.$this->theme; } return new HtmlString(($inliner ?: new CssToInlineStyles)->convert( $contents, $this->view->make($theme, $data)->render() )); } /** * Render the Markdown template into text. * * @param string $view * @param array $data * @return \Illuminate\Support\HtmlString */ public function renderText($view, array $data = []) { $this->view->flushFinderCache(); $contents = $this->view->replaceNamespace( 'mail', $this->textComponentPaths() )->make($view, $data)->render(); return new HtmlString( html_entity_decode(preg_replace("/[\r\n]{2,}/", "\n\n", $contents), ENT_QUOTES, 'UTF-8') ); } /** * Parse the given Markdown text into HTML. * * @param string $text * @return \Illuminate\Support\HtmlString */ public static function parse($text) { $environment = new Environment([ 'allow_unsafe_links' => false, ]); $environment->addExtension(new CommonMarkCoreExtension); $environment->addExtension(new TableExtension); $converter = new MarkdownConverter($environment); return new HtmlString($converter->convert($text)->getContent()); } /** * Get the HTML component paths. * * @return array */ public function htmlComponentPaths() { return array_map(function ($path) { return $path.'/html'; }, $this->componentPaths()); } /** * Get the text component paths. * * @return array */ public function textComponentPaths() { return array_map(function ($path) { return $path.'/text'; }, $this->componentPaths()); } /** * Get the component paths. * * @return array */ protected function componentPaths() { return array_unique(array_merge($this->componentPaths, [ __DIR__.'/resources/views', ])); } /** * Register new mail component paths. * * @param array $paths * @return void */ public function loadComponentsFrom(array $paths = []) { $this->componentPaths = $paths; } /** * Set the default theme to be used. * * @param string $theme * @return $this */ public function theme($theme) { $this->theme = $theme; return $this; } /** * Get the theme currently being used by the renderer. * * @return string */ public function getTheme() { return $this->theme; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 4 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Events
DIR
-
drwxrwxrwx
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Mailables
DIR
-
drwxrwxrwx
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
resources
DIR
-
drwxrwxrwx
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Transport
DIR
-
drwxrwxrwx
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Attachment.php
5.12 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
composer.json
1.56 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE.md
1.05 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Mailable.php
46.29 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Mailer.php
18.38 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MailManager.php
17.88 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MailServiceProvider.php
1.72 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Markdown.php
4.56 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Message.php
9.91 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PendingMail.php
3.78 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SendQueuedMailable.php
3.60 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SentMessage.php
2.02 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TextMessage.php
1.38 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).