Skip to content

Commit 11f5368

Browse files
committed
fixed formating by moving from raw(markdown) to sanitize(markdown)
1 parent 589fed6 commit 11f5368

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

README.rdoc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
## Features remaining prior release
2-
3-
* TODO: Get protip uploads to work
4-
* TODO: Fix commenting formatting issue (see: http://localhost:5000/p/lhsrcq/one-line-browser-notepad)
5-
* TODO: Write announcement protip and link it on homepage
6-
71
## Post release backlog
82

93
* TODO: Dragging files into protip editor https://github.com/feross/drag-drop
4+
* TODO: Write announcement protip and link it on homepage
105
* TODO: Basic Caching
116
* TODO: Deleting user
127
* TODO: Team view

app/views/comments/_comment.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.author[:author]
1010
%a.bold.black.no-hover[:alternateName]{href: profile_path(username: comment.user.username)}
1111
=comment.user.username
12-
.content.small[:text]=raw CFM::Markdown.render(comment.body)
12+
.content.small[:text]=sanitize CFM::Markdown.render(comment.body)
1313
.diminish.mt1
1414
==#{time_ago_in_words(comment.created_at)} ago
1515
-if signed_in? && current_user.can_edit?(comment)

app/views/protips/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
=icon 'bolt', class: 'mr1'
2222
Introducing Coderwall 3.0
2323
%p.mt2 We hope this shiny brand new version of Coderwall makes you smile. We're on a mission to make the software world smaller - watch for alot more to come.
24-
%a Read the full announcement
24+
-# %a Read the full announcement
2525
2626
%h4.mt4
2727
=icon 'calendar', class: 'mr1'

app/views/protips/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
-@protip.tags.each do |tag|
5050
%h6.inline=tag
5151
.content.p2.mt3[:articleBody]
52-
= raw CFM::Markdown.render(@protip.body)
52+
= sanitize CFM::Markdown.render(@protip.body)
5353

5454
.author.p2[:author]
5555
%h5.mt0[@protip.user]

app/views/users/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
.clearfix.p0.mt2
6363
%p
6464
.content[:description]
65-
=raw CFM::Markdown.render(@user.about)
65+
= sanitize CFM::Markdown.render(@user.about)
6666
.mt1
6767
-@user.skills.each do |tag|
6868
.inline[:memberOf]=tag

lib/cfm.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ def render(text)
88
return nil if text.nil?
99

1010
extensions = {
11-
fenced_code_blocks: true,
12-
strikethrough: true,
13-
autolink: true
11+
fenced_code_blocks: true,
12+
strikethrough: true,
13+
autolink: true,
14+
no_styles: true,
15+
safe_links_only: true
1416
}
1517

1618
renderer = Redcarpet::Render::HTML.new(link_attributes: {rel: "nofollow"})

0 commit comments

Comments
 (0)