fix 1.2.1 : cache index.md, H1 rendu, scroll wizard, titre Modifier
- ArticleManager : invalider le cache si index.md est plus récent que meta.json - migration_001 : touch(meta.json) après maj index.md pour forcer l'invalidation - post_view.php : masquer le H1 initial du contenu (déjà affiché par le template) - step1.php : en-tête "Modifier" sans le titre de l'article - wizard.js : retirer scrollToCursor (erroné sur auto-resize) ; Ctrl+Home/End via scrollIntoView Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,8 @@ $_accentMap = [
|
||||
];
|
||||
$_tocItems = [];
|
||||
$_tocSeen = [];
|
||||
// Le titre H1 est déjà affiché par le template ; on le retire du rendu.
|
||||
$_rawForRender = preg_replace('/^\s*# [^\n]*\n*/u', '', $rawContent);
|
||||
$_renderedContent = preg_replace_callback(
|
||||
'/<(h[23])>(.+?)<\/h[23]>/i',
|
||||
function ($m) use (&$_tocItems, &$_tocSeen, $_accentMap) {
|
||||
@@ -31,7 +33,7 @@ $_renderedContent = preg_replace_callback(
|
||||
$_tocItems[] = ['level' => $level, 'text' => $plain, 'id' => $id];
|
||||
return "<{$tag} id=\"" . htmlspecialchars($id) . "\">{$inner}</{$tag}>";
|
||||
},
|
||||
$Parsedown->text($rawContent)
|
||||
$Parsedown->text($_rawForRender)
|
||||
);
|
||||
|
||||
ob_start();
|
||||
|
||||
@@ -19,8 +19,7 @@ $_hasUuid = $_wizUuid !== '';
|
||||
<!-- En-tête avec boutons ────────────────────────────────────────────────── -->
|
||||
<div class="d-flex align-items-center justify-content-between gap-3 mb-4 flex-wrap">
|
||||
<div>
|
||||
<h1 class="h4 mb-0" id="wz-page-title"
|
||||
data-prefix="<?= $mode === 'edit' ? 'Modifier — ' : '' ?>"><?= $mode === 'create' ? 'Nouvel article' : htmlspecialchars('Modifier — ' . ($article['title'] ?? '')) ?></h1>
|
||||
<h1 class="h4 mb-0" id="wz-page-title"><?= $mode === 'create' ? 'Nouvel article' : 'Modifier' ?></h1>
|
||||
<?php if ($_hasUuid): ?>
|
||||
<span id="autosave-indicator" class="text-muted small"></span>
|
||||
<?php endif; ?>
|
||||
@@ -44,7 +43,8 @@ $_hasUuid = $_wizUuid !== '';
|
||||
<div class="mb-3">
|
||||
<label for="wz-content" class="form-label fw-semibold">Contenu <small class="text-muted fw-normal">(Markdown)</small></label>
|
||||
<textarea class="form-control font-monospace" id="wz-content" name="content" rows="18"
|
||||
style="min-height:320px"><?= htmlspecialchars($content ?? '') ?></textarea>
|
||||
style="min-height:320px"
|
||||
placeholder="# Titre de l'article Votre contenu ici…"><?= htmlspecialchars($content ?? '') ?></textarea>
|
||||
</div>
|
||||
|
||||
</div><!-- /col-lg-9 -->
|
||||
|
||||
Reference in New Issue
Block a user