It is not possible to add a newline in the output of the poll-description and in comments
If you add <br> it will shown as code there and if you add a line break, it are cut out completely of the output, not even replaced with a space, so the last character and the first of the new line glue together without space.
I can think of two solutions:
<br> in comments and the description I prefer the first or third solutions, the first is easy to achieve with PHP strip_tags, Example:
// allow <br> <p> and <a>:
echo strip_tags($text, '<br><p><a>');
It is strange, cause this line already looks like it wouls show a BR in place of a new line:
https://github.com/nextcloud/polls/blob/master/templates/vote.tmpl.php#L96
$description = str_replace(array('\r\n', '\r', '\n'), '<br/>', htmlspecialchars($poll->getDescription()));
The function getDescription is not in the Polls-sourcecode, so it may be a bug in another project?
I could think of a solution like this: add this line after the first str_replace:
$description = preg_replace('/<[bBrR]艧*\/*>/', '<br/>', $description);
HTML tags in the description are nearly a running gag. We had many problems including possible vulnerability. I think, this is something worth to be done in the migration of the vote page. After that things get a little bit easier.
Allowing Markdown would be really nice
Most helpful comment
HTML tags in the description are nearly a running gag. We had many problems including possible vulnerability. I think, this is something worth to be done in the migration of the vote page. After that things get a little bit easier.