feat: restore sablog browse modes and clean imported HTML
Build and Deploy / verify (push) Successful in 40s
Build and Deploy / deploy (push) Successful in 36s

Keep the public site readable after import (nbsp, highlighter, wrapping code, compact pager) and finish the admin extras already in this tree: sticky levels, preview, page cache, and live llms.txt.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gouki
2026-09-18 21:33:02 +00:00
co-authored by Cursor
parent 469160dc3f
commit ae47447062
98 changed files with 8618 additions and 901 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Console\Commands;
use App\Blog\Support\SablogHtmlNormalizer;
use App\Models\Post;
use Illuminate\Console\Command;
use League\HTMLToMarkdown\HtmlConverter;
@@ -36,6 +37,7 @@ class ConvertContent extends Command
]);
$renderer = app(\App\Blog\Services\PostContentRenderer::class);
$normalizer = app(SablogHtmlNormalizer::class);
$posts = $query->get();
if ($posts->isEmpty()) {
@@ -49,7 +51,7 @@ class ConvertContent extends Command
foreach ($posts as $post) {
// [attach=xx] 是 markdown 保留字符,先换成令牌,渲染时再解析
$markdown = $converter->convert($renderer->toMarkdownSafeTokens($post->content));
$markdown = $normalizer->toMarkdown((string) $post->content, $converter, $renderer);
if ($this->option('dry-run')) {
$this->newLine();