ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: kou@cozmixng•org
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50630] [Ruby trunk Bug#15058][Closed] REXML::Text#clone returns a text node with a double escaped Sting
Date: Sun, 02 Sep 2018 13:55:14 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-73850.20180902135512.c9164adb477804cd@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15058.20180902092546@ruby-lang.org

Issue #15058 has been updated by kou (Kouhei Sutou).

Status changed from Open to Closed
Assignee set to kou (Kouhei Sutou)

たしかにその通りですね。
そうなるようにしておきました。

近いうちにこの修正が入ったrexml gemをリリースしておきます。

----------------------------------------
Bug #15058: REXML::Text#clone returns a text node with a double escaped Sting
https://bugs.ruby-lang.org/issues/15058#change-73850

* Author: rna (Ryosuke Nanba)
* Status: Closed
* Priority: Normal
* Assignee: kou (Kouhei Sutou)
* Target version: 
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
`REXML::Text#clone` で生成したオブジェクトが元のオブジェクトと異なる値を持ったテキストノードになります。clone されたテキストノードの `to_s` の値は、元のテキストノードが表現する文字列を二重にエスケープしたものになります。

例:
~~~
require 'rexml/document'
t = REXML::Text.new("&lt; <", false, nil, false)
t2 = t.clone
t.to_s    # => "&amp;lt; &lt;"
t2.to_s   # => "&amp;amp;lt; &amp;lt; (expected: "&amp;lt; &lt;")
t == t2   # => false (expected: true)
~~~

clone したテキストノードの値は元のテキストノードと同じ値になるべきです。




-- 
https://bugs.ruby-lang.org/

      parent reply	other threads:[~2018-09-02 13:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15058.20180902092546@ruby-lang.org>
2018-09-02  9:25 ` [ruby-dev:50626] [Ruby trunk Bug#15058] REXML::Text#clone returns a text node with a double escaped Sting rnanba
2018-09-02 13:55 ` kou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-73850.20180902135512.c9164adb477804cd@ruby-lang.org \
    --to=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).