Better html displaying

This commit is contained in:
Robbe Van Herck 2019-12-04 17:08:56 +01:00
parent c442f4fcd2
commit d78c98bd00
No known key found for this signature in database
GPG key ID: A66F76F7B81BD784
3 changed files with 8 additions and 4 deletions

View file

@ -28,11 +28,11 @@ narrow_page: true
<div class="column text_data"> <div class="column text_data">
<div> <div>
<i class="quote"> <i class="quote">
"<%= member[:quote] %>" "<%= to_HTML(member[:quote]) %>"
</i> </i>
</div> </div>
<div class="description_text" style="margin-top: 0.5em"> <div class="description_text" style="margin-top: 0.5em">
<%= member[:description] %> <%= to_HTML(member[:description]) %>
</div> </div>
</div> </div>
<div class="columns links"> <div class="columns links">

View file

@ -5,7 +5,7 @@ data:
nickname: FlashYoshi nickname: FlashYoshi
photo: https://zeus.ugent.be/zeuswpi/0U6neVQP.jpg photo: https://zeus.ugent.be/zeuswpi/0U6neVQP.jpg
quote: Ansible is af! quote: Ansible is af!
description: | description: |-
Puns, weeb, Sigasi, klimt, taart. Puns, weeb, Sigasi, klimt, taart.
Houdt écht van Java. Houdt écht van Java.
Gebruikt tabs én spaces. Gebruikt tabs én spaces.
@ -20,7 +20,7 @@ data:
- name: Felix Van der Jeugt - name: Felix Van der Jeugt
nickname: noctua nickname: noctua
photo: https://zeus.ugent.be/zeuswpi/9_L03Pm8.jpg photo: https://zeus.ugent.be/zeuswpi/9_L03Pm8.jpg
quote: | quote: |-
<noctua> dwergen <noctua> dwergen
<noctua> dwergen <noctua> dwergen
<noctua> dwergen <noctua> dwergen

View file

@ -32,4 +32,8 @@ module AboutHelper
def to_full_year(year) def to_full_year(year)
(year.to_i < 90) ? "20#{year}" : "19#{year}" (year.to_i < 90) ? "20#{year}" : "19#{year}"
end end
def to_HTML(text)
text.gsub("<", "&lt;").gsub(">", "&gt;").gsub("\n", "<br>");
end
end end