Repository navigation
Conversation
rtrim() removed every trailing whitespace character, so a text value ending in CR LF lost its line break in Value. Only spaces are padding for these VRs (PS3.5 Table 6.2-1); CR, LF and FF are part of the text.
✅ Deploy Preview for dcmjs2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rtrim()inValueRepresentation.jsuses/\s*$/. That removes every trailing whitespace character fromValue: spaces, but also CR, LF, FF, tabs, NBSP and the ideographic space. For LT, ST, UT, UC and TM, PS3.5 Table 6.2-1 only allows padding with trailing spaces. CR, LF and FF are part of the text, and the Specific Character Set can include other whitespace characters.An example:
test-SR.dcmfrom the pydicom test files has a TextValue (0040,A160) ofSample Text\rA\nB\r\nC\n\r. dcmjs returnsSample Text\rA\nB\r\nC, while DCMTK'sdcm2jsonkeeps the whole value._rawValuewas already right, so lossless round trips were not affected, onlyValue.rtrim()now removes trailing spaces only.A new "Individual VR comparisons" case in
test/lossless-read-write.test.jscovers a UT ending in CR LF plus a space. On master it fails, because the CR LF is removed fromValue. The full jest suite passes (25 suites, 355 tests), and prettier and eslint are clean on the changed files.