JSFiddle - React, Tailwind, and code Playground
JavaScript
var text = "<-\n>"
var frag = $.buildFragment([text], document);
if( text === frag.childNodes[0].nodeValue ){
$(document.body).append("Text converted to correct text node :-).")
} else {
$(document.body).append(":-( Text node doesn't have the same value as text. Look at the console to see the difference");
console.log(text, frag.childNodes[0].nodeValue);
}