loopbackio / loopbackio/strong-soap

Why the method text.trim() is used on all parser.textNode values in ontext method?

Open
#610 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
410
Forks
162
Avg merge
4h 36m
Merged PRs (30d)
7

Description

In soap response there are whitespaces in element content.

I want them to be preserved, but from the code in strong-soap it seems that the text.trim() method is hardcoded.
It does not accept any options.

Specifically I have an element like this and i need the multiple whitespace to be preserved:

` `

/src/parser/xmlHandler.js:

`p.ontext = function(text) {
text = text && text.trim();
if (!text.length)
return;
...
}`

Thanks for your reply.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in /src/parser/xmlHandler.js at the ontext handler and trace how parser.textNode values are processed. Check existing parser tests or related XML handling to determine the expected behavior, then add coverage showing whether whitespace is preserved and verify the chosen behavior with the test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.