mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
parse urls for comments
This commit is contained in:
parent
0cbbc938e9
commit
2d9e6c520e
5 changed files with 9 additions and 2 deletions
1
Gemfile
1
Gemfile
|
@ -49,6 +49,7 @@ gem 'acme-client', {
|
||||||
}
|
}
|
||||||
gem 'http'
|
gem 'http'
|
||||||
gem 'htmlentities'
|
gem 'htmlentities'
|
||||||
|
gem 'rinku'
|
||||||
|
|
||||||
platform :mri, :rbx do
|
platform :mri, :rbx do
|
||||||
gem 'magic' # sudo apt-get install file, For OSX: brew install libmagic
|
gem 'magic' # sudo apt-get install file, For OSX: brew install libmagic
|
||||||
|
|
|
@ -182,6 +182,7 @@ GEM
|
||||||
http-cookie (>= 1.0.2, < 2.0)
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 3.0)
|
mime-types (>= 1.16, < 3.0)
|
||||||
netrc (~> 0.7)
|
netrc (~> 0.7)
|
||||||
|
rinku (2.0.0)
|
||||||
rmagick (2.15.4)
|
rmagick (2.15.4)
|
||||||
ruby-progressbar (1.7.5)
|
ruby-progressbar (1.7.5)
|
||||||
rye (0.9.13)
|
rye (0.9.13)
|
||||||
|
@ -318,6 +319,7 @@ DEPENDENCIES
|
||||||
redis
|
redis
|
||||||
redis-namespace
|
redis-namespace
|
||||||
rest-client
|
rest-client
|
||||||
|
rinku
|
||||||
rmagick
|
rmagick
|
||||||
ruby-debug
|
ruby-debug
|
||||||
rye
|
rye
|
||||||
|
|
|
@ -132,3 +132,7 @@ def email_not_validated?
|
||||||
|
|
||||||
current_site && current_site.parent? && !current_site.is_education && !current_site.email_confirmed && !current_site.supporter?
|
current_site && current_site.parent? && !current_site.is_education && !current_site.email_confirmed && !current_site.supporter?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sanitize_comment(text)
|
||||||
|
Rinku.auto_link Sanitize.fragment(text), :all, 'target="_blank" rel="nofollow"'
|
||||||
|
end
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
<span class="date">
|
<span class="date">
|
||||||
<a href="/site/<%= comment_event_site.username %>?event_id=<%= event.id %>"><%= comment.created_at.ago %></a>
|
<a href="/site/<%= comment_event_site.username %>?event_id=<%= event.id %>"><%= comment.created_at.ago %></a>
|
||||||
</span>
|
</span>
|
||||||
<p><%= comment.message %></p>
|
<p><%== sanitize_comment comment.message %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<% comment_likes_count = comment.comment_likes_dataset.count %>
|
<% comment_likes_count = comment.comment_likes_dataset.count %>
|
||||||
|
|
|
@ -22,5 +22,5 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div style="margin-bottom: 10px"><%= profile_comment.message %></div>
|
<div style="margin-bottom: 10px"><%== sanitize_comment profile_comment.message %></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue