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

Incorrect handling of special html characters #361

Closed
brandon-fryslie opened this issue Nov 13, 2011 · 2 comments
Closed

Incorrect handling of special html characters #361

brandon-fryslie opened this issue Nov 13, 2011 · 2 comments

Comments

@brandon-fryslie
Copy link

When using jsdom it will strip characters from my textareas. Here is how to reproduce:

jsdom.env({
    html: '<html><body><textarea id="grammar"></textarea></body></html>'
    scripts: ['http://code.jquery.com/jquery-1.6.2.min.js']
    done: function (err, window) {
        $ = window.$
        // This will be false
        $('#grammar').val('>')
        console.log('>' == $('#grammar').val())
    }
});

That comparison will be true in Google Chrome on OS X. I haven't tested other systems/configurations.

@papandreou
Copy link
Contributor

Bummer, it looks like the value property is being parsed as HTML:

var doc = require('jsdom').jsdom('<html><body><textarea id="grammar"></textarea></body></html>');

doc.getElementById('grammar').value = '<foo>';
console.warn(doc.getElementById('grammar').value); // "<foo></foo>"

@brandon-fryslie
Copy link
Author

Gracias amigo! The wonders of open source software. :)

Brandon

On Sun, Nov 13, 2011 at 3:45 AM, Andreas Lind Petersen <
reply@reply.github.com

wrote:

Bummer, it looks like the value property is being parsed as HTML:

var doc = require('jsdom').jsdom('<textarea id="grammar"></textarea>');

doc.getElementById('grammar').value = '';
console.warn(doc.getElementById('grammar').value); // ""


Reply to this email directly or view it on GitHub:
#361 (comment)

@tmpvar tmpvar closed this as completed in d41a58f Nov 21, 2011
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

3 participants