Skip to content

Commit

Permalink
fix: as of parsby 1.1, IO can be mutated during parsing
Browse files Browse the repository at this point in the history
See https://github.com/jolmg/parsby/blob/534f8a95b40cd7102bb55abd2a02ef576a9198da/lib/parsby.rb#L572C11-L572C17

Trace:
IOError: ot 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'
  • Loading branch information
colinux committed Apr 28, 2024
1 parent dc1471c commit 5603cc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/tags_substitution_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module TagsParser
extend self

def parse(io)
doc.parse io
doc.parse +io # parsby mutates the StringIO during parsing!
end

def self.normalize(str)
Expand Down

0 comments on commit 5603cc9

Please sign in to comment.