Keeping HTML Special Characters

20 views
Skip to first unread message

J-C Lavoie

unread,
Feb 15, 2021, 9:45:10 PM2/15/21
to jsdom
Hello,

I would like to know if it's possible to keep special characters when we serialize the DOM?
Example:
source used to send in JSDOM
<p>&#234;tre</p>
there is the result when I serialized the DOM the keep back the code.
<p>être</p>

All HTML special characters have been converted to "humain readable" characters.

More specificly, I would like to keep special characters code with number instead of name.
Example: I don't care that &ecirc; be converted but I want to keep &#234; (its numbered equivalent).

Is it possible?? If yes, how??

The reason is that I use JSDOM to manipulate the HTML code and some special characters MUST be coded instead of being humain readable.

Thanks!!!

..jc

Domenic Denicola

unread,
Feb 16, 2021, 9:18:50 AM2/16/21
to js...@googlegroups.com
It is not, since this cannot be done in browsers and jsdom implements browser specifications.

From: J-C Lavoie <jclav...@gmail.com>
Sent: Monday, February 15, 2021 21:45
To: jsdom
Subject: Keeping HTML Special Characters

--
You received this message because you are subscribed to the Google Groups "jsdom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsdom+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsdom/11ae7779-99ff-4b75-96b5-9984ee3c6b7cn%40googlegroups.com.

J-C Lavoie

unread,
Feb 16, 2021, 6:40:39 PM2/16/21
to js...@googlegroups.com
Thanks for this quick answer!!
I'll find another solution. 

..jc

You received this message because you are subscribed to a topic in the Google Groups "jsdom" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsdom/Qr4NbqNIceM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsdom+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsdom/00a08fe8-a8fe-4a82-8938-6b9071e9bcbb%40domenic.me.
Reply all
Reply to author
Forward
0 new messages