forked from laysense/laysense.cn
23 lines
1.1 KiB
PHP
23 lines
1.1 KiB
PHP
<?php
|
||
use App\Content\View;
|
||
|
||
$e = View::escape(...);
|
||
?>
|
||
<div class="editor" data-editor data-format="<?= $format ?>">
|
||
<label for="editor-text">正文(<?= $format === 'markdown' ? 'Markdown' : 'HTML' ?>)</label>
|
||
<div class="editor-toolbar">
|
||
<div role="group" aria-label="插入格式">
|
||
<button type="button" data-insert="heading">小标题</button>
|
||
<button type="button" data-insert="bold">粗体</button>
|
||
<button type="button" data-insert="list">列表</button>
|
||
<button type="button" data-insert="link">链接</button>
|
||
</div>
|
||
<button data-preview-button type="button" aria-controls="editor-preview" aria-expanded="false">预览正文</button>
|
||
</div>
|
||
<textarea id="editor-text" name="body" rows="15" spellcheck="false"><?= $e($body) ?></textarea>
|
||
<?php if ($format === 'html'): ?>
|
||
<p class="field-note">支持段落、标题、链接、图片、列表、表格和折叠问答。保存时会清理脚本、内联样式等标签或属性。</p>
|
||
<?php endif ?>
|
||
<div class="editor-preview rich prose" id="editor-preview" aria-live="polite" hidden></div>
|
||
</div>
|