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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 818d22d7f95ad8d6e04cd9873ac17c76b45e214a
4
- data.tar.gz: 5969729a1fd18825c7ee8769570b06091afa9d1f
3
+ metadata.gz: b9b315f8ad4b0cf0028ab69db1bdae35dd00c4a4
4
+ data.tar.gz: b7a5c639356777eca4411779b489382111547a99
5
5
  SHA512:
6
- metadata.gz: b58be67dccb5256cd6f0d9de0eab7be4e6d3654de867167859faa9d15d0e7721aeebd32b0fba89b6e81c5817b0d632536a8d6d32f6bb51568709b86c11636d29
7
- data.tar.gz: a8e35db53495bf2b95bb11c6b605d17b3afbff46f321b7a35d3e2c1825b736cebddc15134c7e9930b1fb63dacb9807311c9c02cc049c5fc5896a29a96dfb16c4
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 = lines.first[%r{^\s+}]
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
@@ -2,7 +2,7 @@ module HtmlBeautifier #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 3
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join(".")
8
8
  end
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.0
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-03-20 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake