Add the editor: toolbar, photos in the text, a server preview and a focus point
This commit is contained in:
1 parent
6b41bfddd3
commit
6a51b0e649
18 files changed
+224
-17
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace IriksIT\Manager\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use IriksIT\Manager\Support\Markdown;
|
||||
|
||||
/** The preview of the editor: the text as the site renders it (raw HTML is escaped there, so the answer is safe to show). */
|
||||
class MarkdownController
|
||||
{
|
||||
public function __invoke(Request $request): JsonResponse
|
||||
{
|
||||
$data = $request->validate(['text' => ['nullable', 'string', 'max:200000']]);
|
||||
|
||||
return response()->json(['html' => Markdown::toHtml((string) ($data['text'] ?? ''))]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user