Closed acanalis closed 3 years ago
Are you getting the code from the textarea or the pre in your code?
I was getting it from the code element via document.querySelector("#pg-1 code").textContent
, where the pg-1
is an id from a container div.
I just checked though: when I take it from the pre element I get the same error.
When I take it from the textarea, I don't get the +U200B, but the content of the textarea is always fixed to the initial one.
Use textarea.value
to get the code. The pre/code elements are presentation. I suspect you are getting the initial value because you're using textarea.textContent
.
Thanks, works perfectly! I'm marking this as closed.
Hello!
I was working on a Go playground + Prism app. In essence, I take the code from a prism-live textarea and send it to an API of https://play.golang.org/ to be processed, and I get this error:
The problem character is a Zero Width Space character (U+200B) that was added by prism-live.js at line 339, col 13. I don't know how frequently this could happen to others, but maybe it's best to keep a strict copy of the code in the text area.
Thanks for all your work!