From 992c61b51a2b6a7981bd978b117170f9c71cd21f Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 29 Apr 2024 00:29:25 +0200 Subject: [PATCH] fix: as of parsby 1.1, IO can be mutated during parsing See https://github.com/jolmg/parsby/blob/534f8a95b40cd7102bb55abd2a02ef576a9198da/lib/parsby.rb#L572C11-L572C17 Trace: IOError: not modifiable string # parsby-1.1.1/lib/parsby.rb:572:in `ungetc' # parsby-1.1.1/lib/parsby.rb:572:in `ungetc' # parsby-1.1.1/lib/parsby.rb:539:in `block in restore' # parsby-1.1.1/lib/parsby.rb:539:in `each' --- app/models/concerns/tags_substitution_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/tags_substitution_concern.rb b/app/models/concerns/tags_substitution_concern.rb index ab8df1cff..607029d12 100644 --- a/app/models/concerns/tags_substitution_concern.rb +++ b/app/models/concerns/tags_substitution_concern.rb @@ -12,7 +12,7 @@ module TagsSubstitutionConcern extend self def parse(io) - doc.parse io + doc.parse(+io) # parsby mutates the StringIO during parsing! end def self.normalize(str)