Prevent snakeYAML add backslash when dump multiple line string
Open
Nobody has claimed this yet.
JRuby
- Dominant language
- Ruby
- Stars
- 597
- Forks
- 223
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 3
Description
Given the following input
key:
"/Psych is a YAML parser and emitter. Psych leverages libyaml
for its YAML parsing and emitting capabilities. In addition to wrapping
libyaml, Psych also knows how to serialize and de-serialize most Ruby
objects to and from the YAML format./"
empty_key:
Then load and dump it:
Within MRI ruby, the output is:
---
key: "/Psych is a YAML parser and emitter. Psych leverages libyaml for its YAML parsing
and emitting capabilities. In addition to wrapping libyaml, Psych also knows how
to serialize and de-serialize most Ruby objects to and from the YAML format./"
empty_key: #An empty space was added here.
But in jruby, the result is a little different:
---
key: "/Psych is a YAML parser and emitter. Psych leverages libyaml for its YAML parsing\
\ and emitting capabilities. In addition to wrapping libyaml, Psych also knows how\
\ to serialize and de-serialize most Ruby objects to and from the YAML format./"
empty_key:
There are two differences:
- Jruby added backslashes for new line
- MRI ruby added a space after empty_key:
Contributor guide
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.
Research direction
Start by reproducing the provided YAML load-and-dump example under MRI Ruby and JRuby, then compare the emitted multiline string and empty_key output. The work is done when the relevant output differences are resolved consistently and the same example verifies the result in both runtimes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100