mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 10:40:00 +00:00
Replace newlines with html entities in torrent description
Fixes #60 On production, Cloudflare minifies our HTML which removes blank newlines from the source and therefore the description. Replacing them with HTML entities fixes the problem.
This commit is contained in:
parent
16c30413dc
commit
2c013090e0
|
@ -60,7 +60,8 @@
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-body" id="torrent-description">
|
<div class="panel-body" id="torrent-description">
|
||||||
{% if torrent.description %}
|
{% if torrent.description %}
|
||||||
{{ torrent.description | escape }}
|
{# Escape newlines into html entities because CF strips blank newlines #}
|
||||||
|
{{ torrent.description | escape | replace('\r\n', '\n') | replace('\n', ' '|safe) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
#### No description.
|
#### No description.
|
||||||
{% endif%}
|
{% endif%}
|
||||||
|
|
Loading…
Reference in a new issue