Skip to content

Commit

Permalink
Allow basic text style modifiers in activity overview
Browse files Browse the repository at this point in the history
Allows `<del>`, `<em>`, and `<strong>` tags as these may be semantically
important for the activity.

Also applies to the frontpage to prevent excessive usage of modifiers.
  • Loading branch information
tomudding committed Nov 18, 2023
1 parent d8e44cb commit e13f0bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion module/Activity/view/activity/activity/list.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use Laminas\View\Renderer\PhpRenderer;
<div class="col-md-8 reveal reveal-10">
<?= strip_tags(
$this->markdown($this->localiseText($activity->getDescription())),
['<p>'],
['<p>', '<del>', '<em>', '<strong>'],
) ?>
<a class="reveal-button"><?= $this->translate('Continue reading') ?></a>
</div>
Expand Down
11 changes: 7 additions & 4 deletions module/Frontpage/view/frontpage/frontpage/home.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,21 @@ $lang = $this->plugin('translate')->getTranslator()->getLocale();
<?php foreach ($news as $item): ?>
<?php
if ($item instanceof ActivityModel) {
$title = $item->getName()->getText($lang);
$content = $item->getDescription()->getText($lang);
$title = $this->localiseText($item->getName());
$content = strip_tags(
$this->markdown($this->localiseText($item->getDescription())),
['<p>', '<del>', '<em>', '<strong>'],
);
} else {
$title = ($lang === 'en') ? $item->getEnglishTitle() : $item->getDutchTitle();
$content = ($lang === 'en') ? $item->getEnglishContent() : $item->getDutchContent();
$content = $this->markdown(($lang === 'en') ? $item->getEnglishContent() : $item->getDutchContent());
}
?>
<article class="content-article">
<h3><?= $this->escapeHtml($title) ?></h3>
<div style="position: relative; overflow: hidden;">
<div class="reveal reveal-10">
<?= $this->markdown($content) ?>
<?= $content ?>
<a class="reveal-button"><?= $this->translate('Continue reading') ?></a>
</div>
</div>
Expand Down

0 comments on commit e13f0bc

Please sign in to comment.