nokogumbo 1.4.10 → 1.4.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c97bf9e43a0be85f20cf07ec15901052a1f9dbe1
4
- data.tar.gz: 4c195ae6b3fc161648b7fc0c7eea06d14e8bd451
3
+ metadata.gz: 2db71be04413780e16757ce18152b4841db79dc8
4
+ data.tar.gz: 4b33b6a76a1add1a39615e973218ae89cab22592
5
5
  SHA512:
6
- metadata.gz: f49c427bdb96bce746e541c7864c755b0ece284f0f7fff8d0f3913403b8c9e9941b1d9c06ddec25142be4ee7ead2c97e96b9eac26eeee119cbb6cfc1879d5f7b
7
- data.tar.gz: bf2b358e4f496f5f8e1c3b308e8c7befc308b9dda1af7399d4baa73cc59a395f630d315a5791565a088d7dfdf9c9a0eaaea5638798da6a2dfc6cea559df1fa25
6
+ metadata.gz: 2f292053fef636c5d57b8f76ecb8a5eda0994149e95a58b5a1968347364050a278a9302f21515bd08c7bf4ce0000f7ae706fca888b1c90b4f3c9f2cdb4c13919
7
+ data.tar.gz: fd47e4204807f5d0dc0e7821efdc35a292530a08ba1d878d2b155db34acad33bd0f98c4575e3103ebf29f679f3667f2e14bbbe40305a8cc81a8920c0adf7ce0c
@@ -227,6 +227,13 @@ static VALUE parse(VALUE self, VALUE string) {
227
227
  for (int i=0; i < errors->length; i++) {
228
228
  GumboError *err = errors->data[i];
229
229
  gumbo_string_buffer_clear(&parser, &msg);
230
+ // Work around bug in gumbo_caret_diagnostic_to_string.
231
+ // See https://github.com/google/gumbo-parser/pull/371
232
+ // The bug occurs when the error starts with a newline (unless it's the
233
+ // first character in the input--but that shouldn't cause an error in
234
+ // the first place.
235
+ if (*err->original_text == '\n' && err->original_text != input)
236
+ --err->original_text;
230
237
  gumbo_caret_diagnostic_to_string(&parser, err, input, &msg);
231
238
  VALUE err_str = rb_str_new(msg.data, msg.length);
232
239
  VALUE syntax_error = rb_class_new_instance(1, &err_str, XMLSyntaxError);
@@ -132,6 +132,11 @@ class TestNokogumbo < Minitest::Test
132
132
  assert_empty doc.errors
133
133
  end
134
134
 
135
+ def test_parse_fragment_errors
136
+ doc = Nokogiri::HTML5.fragment("<\r\n")
137
+ refute_empty doc.errors
138
+ end
139
+
135
140
  private
136
141
 
137
142
  def buffer
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogumbo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.10
4
+ version: 1.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-01 00:00:00.000000000 Z
11
+ date: 2017-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.5.1
93
+ rubygems_version: 2.6.11
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Nokogiri interface to the Gumbo HTML5 parser