oga 0.3.3-java → 0.3.4-java

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: 5e5eae7184738ed26011bc86192ce7468a56d8d0
4
- data.tar.gz: fa9d98441fa84f22ef644e665ec5c41182f2951e
3
+ metadata.gz: d6dab71dd0f5c74363b5f4a86873a9cd8e254650
4
+ data.tar.gz: 0c8c46ad063f3788e226023c00327736c9868552
5
5
  SHA512:
6
- metadata.gz: aa892fc40ac36551956ef575d9ab5e2dab140189bda839a69967e674623a7f31c8aaca66d60be5220e27aa22bf6cc8902474e0b0d6ff0287b30db28c52a1460f
7
- data.tar.gz: d0a80c1f2fbb161d8eef7eebeea2f77de994fc26be170a7d5b6d378a50220e17a724a2236f025ba44991b96d2c7272a84eb69ab005ab4e87c3478083cdb4f218
6
+ metadata.gz: 40f2855864d4b404c51570a752a5d89b374fb60f810ea73cda54978da00ec351aa8f76eedf6e88ea612b617c8a3a34e76f8eeff33ca5bd75657b77773a528450
7
+ data.tar.gz: 193cf32aca15cd292ad00ed3d189a9d5653039faa039606588dae99406fb97e855c4ac2d9f4df3c3e51958f442086f3eb5808533510101cf17287f023a7e79a3
data/lib/liboga.jar CHANGED
Binary file
data/lib/oga/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oga
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end # Oga
data/lib/oga/xml/lexer.rb CHANGED
@@ -162,6 +162,20 @@ module Oga
162
162
  return !!html
163
163
  end
164
164
 
165
+ ##
166
+ # @return [TrueClass|FalseClass]
167
+ #
168
+ def html_script?
169
+ return html? && current_element == HTML_SCRIPT
170
+ end
171
+
172
+ ##
173
+ # @return [TrueClass|FalseClass]
174
+ #
175
+ def html_style?
176
+ return html? && current_element == HTML_STYLE
177
+ end
178
+
165
179
  private
166
180
 
167
181
  ##
@@ -194,20 +208,6 @@ module Oga
194
208
  return @elements.last
195
209
  end
196
210
 
197
- ##
198
- # @return [TrueClass|FalseClass]
199
- #
200
- def html_script?
201
- return html? && current_element == HTML_SCRIPT
202
- end
203
-
204
- ##
205
- # @return [TrueClass|FalseClass]
206
- #
207
- def html_style?
208
- return html? && current_element == HTML_STYLE
209
- end
210
-
211
211
  ##
212
212
  # Called when processing a single quote.
213
213
  #
@@ -128,6 +128,10 @@ module Oga
128
128
 
129
129
  key = ns ? "#{ns}:#{name}" : name
130
130
 
131
+ if value
132
+ value = EntityDecoder.try_decode(value, @lexer.html?)
133
+ end
134
+
131
135
  return {key => value}
132
136
  end
133
137
 
@@ -152,8 +156,30 @@ module Oga
152
156
  return merged
153
157
  end
154
158
 
159
+ ##
160
+ # @param [String] text
161
+ #
162
+ def on_text(text)
163
+ if @handler.respond_to?(:on_text)
164
+ unless inside_literal_html?
165
+ text = EntityDecoder.try_decode(text, @lexer.html?)
166
+ end
167
+
168
+ run_callback(:on_text, text)
169
+ end
170
+
171
+ return
172
+ end
173
+
155
174
  private
156
175
 
176
+ ##
177
+ # @return [TrueClass|FalseClass]
178
+ #
179
+ def inside_literal_html?
180
+ return @lexer.html_script? || @lexer.html_style?
181
+ end
182
+
157
183
  ##
158
184
  # @param [Symbol] method
159
185
  # @param [Array] args
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: java
6
6
  authors:
7
7
  - Yorick Peterse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-18 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast