Problem with context raw?
@kou is already working on this.
Since Feb 2, 2021.
Assessment
This issue has not been assessed yet.
Description
Running ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [i386-mingw32]
xml_string = '<root><foo>&</foo><bar><</bar><baz>></baz><bat>"</bat></root>'
d = Document.new(xml_string, {raw: ['foo', 'baz']})
d.to_s # => "<root><foo>&</foo><bar><</bar><baz>></baz><bat>"</bat></root>"
root = d.root # => <root> ... </>
foo, bar, baz, bat = *d.root
# Each is an Element object:
[foo, bar, baz, bat].map {|e| e.class }.uniq # => [REXML::Element]
# Each element is marked as raw/not-raw as appropriate:
[foo, bar, baz, bat].map {|e| e.raw } # => [true, false, true, false]
# The first child of each is a Text object:
[foo, bar, baz, bat].map {|e| e.first.class }.uniq # => [REXML::Text]
# Each text is marked as raw/not-raw as appropriate:
[foo, bar, baz, bat].map {|e| e.first.raw } # => [true, true, true, true]
Is this correct? I expected that last result to be [true, false, true, false].
- Dominant language
- Ruby
- Stars
- 181
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/rexml
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
XPath underscored function name is wrongly acceptedPossibly taken @sjh9714 claimed this 80 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Similar issues
-
bug f:request-creation professional
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mysociety/alaveteli#9733 · 1 comment ·
Maintainers usually reply within 1 day
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 13 days
-
🐛 bug 👩💻 équipe CE 🧑🏭 entreprises
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
betagouv/conseillers-entreprises#4808 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day