html_press 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -108,7 +108,7 @@ module HtmlPress
108
108
  out.gsub /(<pre\b[^>]*?>([\s\S]*?)<\/pre>)\s*/i do
109
109
  pre = $2
110
110
  m = $1
111
- pre_compressed = pre.gsub(/\s+$/, '')
111
+ pre_compressed = pre.lines.map{ |l| l.gsub(/\s+$/, '') }.join("\n")
112
112
  pre_compressed = HtmlPress.entities_compressor pre_compressed
113
113
  m.gsub!(pre, pre_compressed)
114
114
  reserve m
@@ -1,3 +1,3 @@
1
1
  module HtmlPress
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
@@ -31,7 +31,8 @@ describe HtmlPress do
31
31
 
32
32
  it "should leave newlines in pre tags and remove trailing spaces" do
33
33
  HtmlPress.press("<pre>a \t </pre>").should eql "<pre>a</pre>"
34
- HtmlPress.press("<pre>qwe \nasd </pre>").should eql "<pre>qwe\nasd</pre>"
34
+ HtmlPress.press("<pre>qwe \r\nasd </pre>").should eql "<pre>qwe\nasd</pre>"
35
+ HtmlPress.press("<pre> qwe \n\r\n asd </pre>").should eql "<pre> qwe\n\n asd</pre>"
35
36
  end
36
37
 
37
38
  it "should leave textareas as is" do
metadata CHANGED
@@ -1,104 +1,103 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: html_press
3
- version: !ruby/object:Gem::Version
4
- hash: 1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- - 1
10
- version: 0.7.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - stereobooster
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-10-06 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-10-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rspec
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :development
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: rake
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
38
33
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
46
38
  type: :development
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: css_press
50
39
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: css_press
48
+ requirement: !ruby/object:Gem::Requirement
52
49
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 23
57
- segments:
58
- - 0
59
- - 3
60
- - 2
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
61
53
  version: 0.3.2
62
54
  type: :runtime
63
- version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: uglifier
66
55
  prerelease: false
67
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
68
57
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.3.2
62
+ - !ruby/object:Gem::Dependency
63
+ name: uglifier
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
76
70
  type: :runtime
77
- version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: htmlentities
80
71
  prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
82
73
  none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: htmlentities
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
90
86
  type: :runtime
91
- version_requirements: *id005
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
92
94
  description: Ruby gem for compressing html
93
- email:
95
+ email:
94
96
  - stereobooster@gmail.com
95
97
  executables: []
96
-
97
98
  extensions: []
98
-
99
99
  extra_rdoc_files: []
100
-
101
- files:
100
+ files:
102
101
  - .gitignore
103
102
  - .travis.yml
104
103
  - Gemfile
@@ -116,36 +115,26 @@ files:
116
115
  - spec/html_press_spec.rb
117
116
  homepage: https://github.com/stereobooster/html_press
118
117
  licenses: []
119
-
120
118
  post_install_message:
121
119
  rdoc_options: []
122
-
123
- require_paths:
120
+ require_paths:
124
121
  - lib
125
- required_ruby_version: !ruby/object:Gem::Requirement
122
+ required_ruby_version: !ruby/object:Gem::Requirement
126
123
  none: false
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- hash: 3
131
- segments:
132
- - 0
133
- version: "0"
134
- required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
129
  none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- hash: 3
140
- segments:
141
- - 0
142
- version: "0"
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
143
134
  requirements: []
144
-
145
135
  rubyforge_project: html_press
146
136
  rubygems_version: 1.8.24
147
137
  signing_key:
148
138
  specification_version: 3
149
139
  summary: Compress html
150
140
  test_files: []
151
-