From f3789203b69f37e7df7bec55808dbe350c1315d6 Mon Sep 17 00:00:00 2001 From: Peter Ohler Date: Tue, 11 Feb 2025 17:29:04 -0500 Subject: [PATCH] Tolerant keep (#371) * Fix tolerant gobbling * Update release date --- CHANGELOG.md | 6 ++++++ ext/ox/parse.c | 6 +++++- lib/ox/version.rb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 196b9d6..3f6f402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All changes to the Ox gem are documented here. Releases follow semantic versioning. +## [2.14.22] - 2025-02-11 + +### Fixed + +- Fix issue with first text character lost after unquoted attribute value. + ## [2.14.21] - 2025-01-15 ### Fixed diff --git a/ext/ox/parse.c b/ext/ox/parse.c index 6809929..1507fc9 100644 --- a/ext/ox/parse.c +++ b/ext/ox/parse.c @@ -692,8 +692,12 @@ static char *read_element(PInfo pi) { break; } } else { /* read as TEXT */ + char prev = *(start - 1); + pi->s = start; - /*pi->s--; */ + if ('>' != prev && (' ' <= prev || is_white(prev))) { + pi->s--; + } read_text(pi); /*read_reduced_text(pi); */ diff --git a/lib/ox/version.rb b/lib/ox/version.rb index 542c69f..f6e93a1 100644 --- a/lib/ox/version.rb +++ b/lib/ox/version.rb @@ -1,4 +1,4 @@ module Ox # Current version of the module. - VERSION = '2.14.21' + VERSION = '2.14.22' end