formatize 1.1.0 → 2.0.0rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 David Trasbo
1
+ Copyright (c) 2012 David Trasbo
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/README.md CHANGED
@@ -33,7 +33,7 @@ When necessary, flags are listed as such:
33
33
  # => "(snip)"
34
34
 
35
35
  [The `RedCloth` documentation](http://redcloth.rubyforge.org/classes/RedCloth/TextileDoc.html)
36
- lists the available flags. The `textilize_without_paragraps` method
36
+ lists the available flags. The `textilize_without_paragraph` method
37
37
  delegates to `textilize` but strips the surrounding `<p>` tags.
38
38
 
39
39
  ### The `markdown` helper method
@@ -65,6 +65,10 @@ it's useful to be able to bypass the pre-parsing sanitization. Two ways:
65
65
  2. Use the special `:safe` flag, which is not passed on to the parser.
66
66
  _(Deprecated in 1.1, removed in 2.0)._
67
67
 
68
+ With Rails' `sanitize`, if you don't bypass it, you can choose which tags and
69
+ attributes to allow as described in the
70
+ [documentation](http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize).
71
+
68
72
  Compatibility
69
73
  -------------
70
74
 
@@ -25,11 +25,11 @@ module Formatize
25
25
  def textilize(text, *flags)
26
26
  require 'RedCloth'
27
27
 
28
- if safe = flags.delete(:safe)
29
- ActiveSupport::Deprecation.warn('The :safe flag is deprecated. Mark the input HTML safe instead.')
28
+ if flags.include?(:safe)
29
+ raise ArgumentError, 'The :safe flag has been removed. Mark the input HTML safe instead or downgrade to Formatize 1.x'
30
30
  end
31
31
 
32
- text = sanitize(text) unless text.html_safe? || safe
32
+ text = sanitize(text) unless text.html_safe?
33
33
 
34
34
  if text.blank?
35
35
  ""
@@ -73,11 +73,11 @@ module Formatize
73
73
  def markdown(text, *flags)
74
74
  require 'bluecloth'
75
75
 
76
- if safe = flags.delete(:safe)
77
- ActiveSupport::Deprecation.warn('The :safe flag is deprecated. Mark the input HTML safe instead.')
76
+ if flags.include?(:safe)
77
+ raise ArgumentError, 'The :safe flag has been removed. Mark the input HTML safe instead or downgrade to Formatize 1.x'
78
78
  end
79
79
 
80
- text = sanitize(text) unless text.html_safe? || safe
80
+ text = sanitize(text) unless text.html_safe?
81
81
 
82
82
  if text.blank?
83
83
  ""
@@ -1,4 +1,4 @@
1
1
  module Formatize
2
- VERSION = '1.1.0'
2
+ VERSION = '2.0.0rc1'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
5
- prerelease:
4
+ version: 2.0.0rc1
5
+ prerelease: 5
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Trasbo
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-02 00:00:00.000000000 Z
12
+ date: 2012-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: RedCloth
16
- requirement: &2152485440 !ruby/object:Gem::Requirement
16
+ requirement: &2152391460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '4.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152485440
24
+ version_requirements: *2152391460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bluecloth
27
- requirement: &2152343560 !ruby/object:Gem::Requirement
27
+ requirement: &2152407240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '2.2'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152343560
35
+ version_requirements: *2152407240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: actionpack
38
- requirement: &2152259580 !ruby/object:Gem::Requirement
38
+ requirement: &2152406580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2152259580
46
+ version_requirements: *2152406580
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &2152136760 !ruby/object:Gem::Requirement
49
+ requirement: &2152406000 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2152136760
57
+ version_requirements: *2152406000
58
58
  description:
59
59
  email: me@dtrasbo.com
60
60
  executables: []
@@ -81,9 +81,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  none: false
83
83
  requirements:
84
- - - ! '>='
84
+ - - ! '>'
85
85
  - !ruby/object:Gem::Version
86
- version: '0'
86
+ version: 1.3.1
87
87
  requirements: []
88
88
  rubyforge_project:
89
89
  rubygems_version: 1.8.16