htmlbeautifier 1.3.0 → 1.3.1
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.
- checksums.yaml +4 -4
- data/lib/htmlbeautifier/builder.rb +5 -1
- data/lib/htmlbeautifier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9b315f8ad4b0cf0028ab69db1bdae35dd00c4a4
|
4
|
+
data.tar.gz: b7a5c639356777eca4411779b489382111547a99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3f3ff9b529fca273e945ecd9a0463673d967160dc12068604a6764e2df2efab6c69da563b217f874fdb93bcc3c816a10a58ebafa6a17f1fbc4b74790597b169
|
7
|
+
data.tar.gz: b3ff2f097c7d4904538f14995ca2071b3aa27fc63cf057e04c0e43fb4eba42b9d7f76f72f61be78c35fd321df6523e86571d2a6aa3a2a03bbbe55c2a9410fa8a
|
@@ -66,7 +66,7 @@ module HtmlBeautifier
|
|
66
66
|
|
67
67
|
def emit_reindented_block_content(code)
|
68
68
|
lines = code.strip.split(%r{\n})
|
69
|
-
indentation =
|
69
|
+
indentation = foreign_block_indentation(code)
|
70
70
|
|
71
71
|
indent
|
72
72
|
new_line
|
@@ -77,6 +77,10 @@ module HtmlBeautifier
|
|
77
77
|
outdent
|
78
78
|
end
|
79
79
|
|
80
|
+
def foreign_block_indentation(code)
|
81
|
+
code.split(%r{\n}).find { |ln| !ln.strip.empty? }[%r{^\s+}]
|
82
|
+
end
|
83
|
+
|
80
84
|
def preformatted_block(opening, content, closing)
|
81
85
|
new_line
|
82
86
|
emit opening, content, closing
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmlbeautifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Battley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|