Render choice data as HTML in results

Created on 6 March 2024, 4 months ago
Updated 23 March 2024, 3 months ago

Problem/Motivation

We can add HTML code to choice when creating a poll. It works when we are viewing a poll and vote. But when we are viewing results, choices are rendering as a plain text

Steps to reproduce

1. Create a new poll
2. Add HTML code to choice, for example <a href="#">test link</a>
3. View poll. Link rendered as HTML
4. View results. Link rendered as text

Proposed resolution

The simple way to fix this, add |raw to {{ choice }} into poll-meter.html.twig

The result:

<dt class="choice-title {{ is_current_selection_class }}">{{ choice|raw }}</dt>

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

ivnish Poland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024