mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Render comments when storing them in the database
Instead of converting package comments from plain text to HTML code when they are displayed, do the conversion when the comment is posted and store the rendered result in the database. The conversion itself is done by a Python script which uses Bleach for sanitizing the text. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
4abde895a5
commit
016b40f99d
9 changed files with 107 additions and 4 deletions
|
@ -103,9 +103,13 @@ if (!isset($count)) {
|
|||
<?php endif; ?>
|
||||
</h4>
|
||||
<div id="<?= isset($pinned) ? "pinned-" : "comment-" ?><?= $row['ID'] ?>-content" class="article-content<?php if ($is_deleted): ?> comment-deleted<?php endif; ?>">
|
||||
<?php if (!empty($row['RenderedComment'])): ?>
|
||||
<?= $row['RenderedComment'] ?>
|
||||
<?php else: ?>
|
||||
<p>
|
||||
<?= parse_comment($row['Comments']) ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue