ruby / ruby/rexml

\r is converted into \n

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
182
Forks
99
Avg merge
2d 23h
Merged PRs (30d)
8

Description

In this example, in an XML document, the character \r is converted to \n.
It was instead expected to keep \r

$ gem list |grep rexml
rexml (default: 3.2.3)
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ irb -v
irb 1.2.1 (2019-12-24)
$ irb
irb(main):001:0> require "rexml/document"
=> true
irb(main):002:0> doc = REXML::Document.new "<a>\r</a>"
irb(main):003:0> doc.root.text
=> "\n"
irb(main):004:0>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported IRB reproduction with REXML::Document.new and checking doc.root.text. Trace the parsing path for the XML text containing \r, then verify that the resulting text preserves \r rather than returning \n. The issue provides no target file or test name, so locating the relevant parser code is part of the work.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.