Permalink
Browse files

Remove h_italic

  • Loading branch information...
1 parent 589f7af commit 2ebace6a7a3cb18912763fcccc4e827047ab7a0e @mwilden mwilden committed Feb 14, 2012
Showing with 0 additions and 24 deletions.
  1. +0 −11 lib/formatters/reference_formatter.rb
  2. +0 −13 spec/lib/formatters/reference_formatter_spec.rb
@@ -29,15 +29,6 @@ def self.format_timestamp timestamp
timestamp.strftime '%Y-%m-%d'
end
- def self.h_italic string
- string = string.gsub /<i>/, 'xxxx'
- string = string.gsub /<\/i>/, 'yyyy'
- string = h string
- string = string.gsub /xxxx/, '<i>'
- string = string.gsub /yyyy/, '</i>'
- string.html_safe
- end
-
##################
def initialize reference
@reference = reference
@@ -70,8 +61,6 @@ def format_inline_citation user
end
private
- def h_italic(string) self.class.h_italic string end
-
def format_date input
date = input
return date if input.length < 4
@@ -116,19 +116,6 @@
@formatter.format(reference).should == 'Forel, A. 1874. Les fourmis de la Suisse. Wiley, 22 pp.'
end
- describe "h_italic" do
- it "should do nothing to a normal string but mark it as safe" do
- string = @formatter.h_italic("string")
- string.should == "string"
- string.should be_html_safe
- end
- it "should strip unsafe text, but leave italics alone" do
- string = @formatter.h_italic("<i><script>foo</i>")
- string.should == "<i>&lt;script&gt;foo</i>"
- string.should be_html_safe
- end
- end
-
describe "unsafe characters" do
before do
@author_names = [Factory(:author_name, :name => 'Ward, P. S.')]

0 comments on commit 2ebace6

Please sign in to comment.