This repository was archived by the owner on Jan 7, 2021. It is now read-only.
CDATA blocks with ] or [ characters inside#2
Merged
Conversation
…at have ] or [ characters inside)
|
Bump. Critical fix, and needs to be in the npm version to deploy to Heroku without getting hacky. Thanks to @andris9 for finding and patching. |
c4milo
added a commit
that referenced
this pull request
Aug 10, 2011
CDATA blocks with ] or [ characters inside Notes in our README regarding no parsing support for CDATA sections will remain. Please notice that we also provide a way to generate reversible json and this patch doesn't resolve that case. The right way to parse CDATA sections will be something like: 1. xml2json: Handling startCdata and endCdata events coming from node-expat 2. xml2json: In order to continue supporting reversible json, generate a new identifier to represent the cdata section in json. 3. json2xml: generate the CDATA sections in xml appropriately 4. write tests
Contributor
|
Thanks Andris for the pull request. I merged your patch but please be aware that notes in our README regarding no parsing support for CDATA sections will remain. Please notice that we also provide a way to generate reversible json and this patch doesn't resolve that case. The right way to parse CDATA sections will be something like:
|
Author
|
Thanks for clarifying and pulling! In my case I was not interested keeping the exact structure of the XML source but just get the text value out from a block sometimes defined as CDATA in my RSS module |
c4milo
pushed a commit
that referenced
this pull request
Nov 15, 2017
Support asymmetric sanitization
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If a CDATA block includes ] or [ characters then the textual data for the element is passed several times in separate blocks. Currently only the last of these blocks is used.
For example
Will be added as the text node as
When actually it should be