ox 2.14.8 → 2.14.9
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/CHANGELOG.md +6 -0
- data/ext/ox/parse.c +1 -1
- data/ext/ox/sax.c +22 -9
- data/lib/ox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3cc19bc7d94f71b8e8252f3b22475383d3700b2cfe7f3e97aeaff4c36dc4730
|
4
|
+
data.tar.gz: 0034552f9848f7215d7533066d5a971c59dbfd1526257b479512489fe30e371b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ea9d757870451eaf28771481fe703ade50de9dc85d91575545be65ba0a65d7a71a4d193684130725ccad58ad506e1b47fd241aef92950c619be7d49779cbef
|
7
|
+
data.tar.gz: cdd97b3ee73f8755cc7a4296c64d41553b03619c7f37f561ad55b958e769e0dc65e652800da0a03b1a9ecb74a17b563188f01a1b8f86fed2d01395ec2eabd587
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
All changes to the Ox gem are documented here. Releases follow semantic versioning.
|
4
4
|
|
5
|
+
## [2.14.9] - 2022-02-11
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
- Fixed the `\r` replacement with `\n` with the SAX parser according to https://www.w3.org/TR/2008/REC-xml-20081126/#sec-line-ends.
|
10
|
+
|
5
11
|
## [2.14.8] - 2022-02-09
|
6
12
|
|
7
13
|
### Fixed
|
data/ext/ox/parse.c
CHANGED
data/ext/ox/sax.c
CHANGED
@@ -307,8 +307,8 @@ static void sax_drive_init(SaxDrive dr, VALUE handler, VALUE io, SaxOptions opti
|
|
307
307
|
dr->encoding = rb_enc_find(ox_default_options.encoding);
|
308
308
|
}
|
309
309
|
dr->utf8 = (NULL == dr->encoding || rb_utf8_encoding() == dr->encoding);
|
310
|
-
if (NULL == dr->encoding || rb_utf8_encoding() == dr->encoding) {
|
311
|
-
dr->get_name = dr->options.symbolize ? ox_utf8_sym : ox_utf8_name;
|
310
|
+
if (NULL == dr->encoding || rb_utf8_encoding() == dr->encoding) { // UTF-8
|
311
|
+
dr->get_name = dr->options.symbolize ? ox_utf8_sym : ox_utf8_name; // TBD UTF8 sym?
|
312
312
|
} else {
|
313
313
|
dr->get_name = dr->options.symbolize ? ox_enc_sym : ox_enc_name;
|
314
314
|
}
|
@@ -334,7 +334,7 @@ static char skipBOM(SaxDrive dr) {
|
|
334
334
|
if (0xEF == (uint8_t)c) { /* only UTF8 is supported */
|
335
335
|
if (0xBB == (uint8_t)buf_get(&dr->buf) && 0xBF == (uint8_t)buf_get(&dr->buf)) {
|
336
336
|
dr->encoding = ox_utf8_encoding;
|
337
|
-
c
|
337
|
+
c = buf_get(&dr->buf);
|
338
338
|
} else {
|
339
339
|
ox_sax_drive_error(dr, BAD_BOM "invalid BOM or a binary file.");
|
340
340
|
c = '\0';
|
@@ -1217,7 +1217,7 @@ static char read_attrs(SaxDrive dr, char c, char termc, char term2, int is_xml,
|
|
1217
1217
|
attr_value = dr->buf.str;
|
1218
1218
|
if (is_encoding) {
|
1219
1219
|
dr->encoding = rb_enc_find(dr->buf.str);
|
1220
|
-
is_encoding
|
1220
|
+
is_encoding = 0;
|
1221
1221
|
}
|
1222
1222
|
}
|
1223
1223
|
if (0 >= dr->blocked && (NULL == h || ActiveOverlay == h->overlay || NestOverlay == h->overlay)) {
|
@@ -1368,7 +1368,8 @@ int ox_sax_collapse_special(SaxDrive dr, char *str, long pos, long line, long co
|
|
1368
1368
|
char *b = str;
|
1369
1369
|
|
1370
1370
|
while ('\0' != *s) {
|
1371
|
-
|
1371
|
+
switch (*s) {
|
1372
|
+
case '&': {
|
1372
1373
|
int c = 0;
|
1373
1374
|
char *end;
|
1374
1375
|
|
@@ -1458,13 +1459,25 @@ int ox_sax_collapse_special(SaxDrive dr, char *str, long pos, long line, long co
|
|
1458
1459
|
}
|
1459
1460
|
*b++ = (char)c;
|
1460
1461
|
col++;
|
1461
|
-
|
1462
|
+
break;
|
1463
|
+
}
|
1464
|
+
case '\r':
|
1465
|
+
s++;
|
1462
1466
|
if ('\n' == *s) {
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1467
|
+
continue;
|
1468
|
+
}
|
1469
|
+
line++;
|
1470
|
+
col = 1;
|
1471
|
+
*b++ = '\n';
|
1472
|
+
break;
|
1473
|
+
case '\n':
|
1474
|
+
line++;
|
1475
|
+
col = 0;
|
1476
|
+
// fall through
|
1477
|
+
default:
|
1466
1478
|
col++;
|
1467
1479
|
*b++ = *s++;
|
1480
|
+
break;
|
1468
1481
|
}
|
1469
1482
|
}
|
1470
1483
|
*b = '\0';
|
data/lib/ox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.14.
|
4
|
+
version: 2.14.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "A fast XML parser and object serializer that uses only standard C lib.\n\nOptimized
|
14
14
|
XML (Ox), as the name implies was written to provide speed optimized\nXML handling.
|