[#85349] [Ruby trunk Bug#14334] Segmentation fault after running rspec (ruby/2.5.0/erb.rb:885 / simplecov/source_file.rb:85) — pragtob@...
Issue #14334 has been updated by PragTob (Tobias Pfeiffer).
3 messages
2018/02/02
[#85358] Re: [ruby-cvs:69220] nobu:r62039 (trunk): compile.c: unnecessary freezing — Eric Wong <normalperson@...>
nobu@ruby-lang.org wrote:
5 messages
2018/02/03
[#85612] Why require autoconf 2.67+ — leam hall <leamhall@...>
Please pardon the intrusion; I am new to Ruby and like to pull the
6 messages
2018/02/17
[#85634] [Ruby trunk Bug#14494] [PATCH] tool/m4/ruby_replace_type.m4 use AC_CHECK_TYPES for HAVE_* macros — normalperson@...
Issue #14494 has been reported by normalperson (Eric Wong).
3 messages
2018/02/19
[#85674] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — matz@...
Issue #13618 has been updated by matz (Yukihiro Matsumoto).
5 messages
2018/02/20
[#85686] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/02/20
matz@ruby-lang.org wrote:
[#85704] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Koichi Sasada <ko1@...>
2018/02/21
On 2018/02/20 18:06, Eric Wong wrote:
[ruby-core:85802] [Ruby trunk Bug#10864][Rejected] REXML adds white space to text property when indent > -1
From:
kou@...
Date:
2018-02-25 08:20:17 UTC
List:
ruby-core #85802
Issue #10864 has been updated by kou (Kouhei Sutou).
Status changed from Assigned to Rejected
If you don't want to add extra spaces with indent, use `transitive: true` option:
```ruby
require 'rexml/document'
xml_string = ''
REXML::Document.new(xml_string).tap do |doc|
doc.add_element('root').tap do |root|
write_text = 'bar'
puts "Write Text: #{write_text.inspect}"
root.add_element('foo').text = write_text
end
doc.write output: xml_string, indent: 4, transitive: true
end
REXML::Document.new(xml_string).tap do |doc|
read_text = doc.elements['/root/foo'].first
puts "Read Text: #{read_text.inspect}"
end
puts "XML String:"
puts xml_string
```
Output:
```text
Write Text: "bar"
Read Text: "bar"
XML String:
<root
><foo
>bar</foo
></root
>
```
----------------------------------------
Bug #10864: REXML adds white space to text property when indent > -1
https://bugs.ruby-lang.org/issues/10864#change-70655
* Author: amclain (Alex McLain)
* Status: Rejected
* Priority: Normal
* Assignee: kou (Kouhei Sutou)
* Target version:
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The following example shows that REXML is adding white space to the text property of elements when setting the :indent option on Document#write greater than -1. The value written should be the same value read.
~~~ruby
require 'rexml/document'
xml_string = ''
REXML::Document.new(xml_string).tap do |doc|
doc.add_element('root').tap do |root|
write_text = 'bar'
puts "Write Text: #{write_text.inspect}"
root.add_element('foo').text = write_text
end
doc.write output: xml_string, indent: 4
end
REXML::Document.new(xml_string).tap do |doc|
read_text = doc.elements['/root/foo'].first
puts "Read Text: #{read_text.inspect}"
end
puts "XML String:"
puts xml_string
~~~
~~~text
Write Text: "bar"
Read Text: "\n bar\n "
XML String:
<root>
<foo>
bar
</foo>
</root>
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>