Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Striping whitespace (e.g. not respecting xml:space="preserve") #47

Open
mririgoyen opened this issue Feb 21, 2018 · 2 comments
Open

Striping whitespace (e.g. not respecting xml:space="preserve") #47

mririgoyen opened this issue Feb 21, 2018 · 2 comments

Comments

@mririgoyen
Copy link

jxon is stripping white space from XML content, especially ones explicitly with the xml:space="preserve" attribute when going from stringToJs.

Example:

<w:r>
  <w:t>Reactful</w:t>
</w:r>
<w:r>
  <w:t xml:space="preserve"> Word</w:t>
</w:r>
"w:r": [
  {
    "w:t": "Reactful"
  },
  {
    "w:t": {
      "$xml:space": "preserve",
      "_": "Word"
    }
  }
]

Notice the space before "Word" being stripped.

@mririgoyen
Copy link
Author

mririgoyen commented Feb 21, 2018

The offending code is in jxon.js, line 138. Removing the .trim() resolves this issue. Would it be possible to have this fixed?

@jvutukur
Copy link

Any update on this ? can it configured to preserve space or not ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants