minimal 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/minimal/template.rb +0 -1
- data/lib/minimal/version.rb +1 -1
- metadata +3 -4
- data/lib/minimal/template/beautify_html.rb +0 -23
data/lib/minimal/template.rb
CHANGED
data/lib/minimal/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 61
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 17
|
10
|
+
version: 0.0.17
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sven Fuchs
|
@@ -58,7 +58,6 @@ extensions: []
|
|
58
58
|
extra_rdoc_files: []
|
59
59
|
|
60
60
|
files:
|
61
|
-
- lib/minimal/template/beautify_html.rb
|
62
61
|
- lib/minimal/template/form_builder_proxy.rb
|
63
62
|
- lib/minimal/template/handler.rb
|
64
63
|
- lib/minimal/template/translated_tags.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'tidy_ffi'
|
2
|
-
|
3
|
-
module Minimal::Template::BeautifyHtml
|
4
|
-
OPTIONS = {
|
5
|
-
:indent => 'yes',
|
6
|
-
:indent_spaces => '2',
|
7
|
-
:wrap => '0',
|
8
|
-
:tidy_mark => false,
|
9
|
-
:char_encoding => 'utf8',
|
10
|
-
:input_encoding => 'utf8',
|
11
|
-
:output_encoding => 'utf8'
|
12
|
-
}
|
13
|
-
|
14
|
-
class << self
|
15
|
-
def after(controller)
|
16
|
-
controller.response.body = tidy(controller.response.body) if controller.request.format.html?
|
17
|
-
end
|
18
|
-
|
19
|
-
def tidy(html)
|
20
|
-
TidyFFI::Tidy.new(html, OPTIONS).clean
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|