No Need to Double-Escape

Apparently, JQuery takes care of all of the
escaping we need. So ditch our own escaping
(which effectively double-escaped everything).
This commit is contained in:
Jacques Distler 2010-02-23 10:16:14 -06:00
parent 42d92a0b37
commit d201f79766

View file

@ -47,10 +47,6 @@ $(function() {
$('#itex_save, #itex_cancel').toggle(on); $('#itex_save, #itex_cancel').toggle(on);
} }
function htmlEscape(string) {
return string.replace(/&/g, '&amp;').replace(/</g, '&lt;');
}
// Function: setItexString(string, url) // Function: setItexString(string, url)
// This function sets the content of of the currently-selected foreignObject element, // This function sets the content of of the currently-selected foreignObject element,
// based on the itex contained in string. // based on the itex contained in string.
@ -72,7 +68,7 @@ $(function() {
var semantics = document.createElementNS(mathns, 'semantics'); var semantics = document.createElementNS(mathns, 'semantics');
var annotation = document.createElementNS(mathns, 'annotation'); var annotation = document.createElementNS(mathns, 'annotation');
annotation.setAttribute('encoding', 'application/x-tex'); annotation.setAttribute('encoding', 'application/x-tex');
annotation.textContent = htmlEscape(tex); annotation.textContent = tex;
var mrow = document.createElementNS(mathns, 'mrow'); var mrow = document.createElementNS(mathns, 'mrow');
var children = data.documentElement.childNodes; var children = data.documentElement.childNodes;
while (children.length > 0) { while (children.length > 0) {
@ -94,10 +90,6 @@ $(function() {
return true; return true;
}; };
function unescapeHTML(str) {
return str.replace(/&amp;/g, '&').replace(/&lt;/g, '<');
}
function showItexEditor() { function showItexEditor() {
var elt = selElems[0]; var elt = selElems[0];
var annotation = jQuery('math > semantics > annotation', elt); var annotation = jQuery('math > semantics > annotation', elt);
@ -106,7 +98,7 @@ $(function() {
toggleSourceButtons(true); toggleSourceButtons(true);
// elt.removeAttribute('fill'); // elt.removeAttribute('fill');
var str = unescapeHTML(annotation.text()); var str = annotation.text();
$('#svg_source_textarea').val(str); $('#svg_source_textarea').val(str);
$('#svg_source_editor').fadeIn(); $('#svg_source_editor').fadeIn();
properlySourceSizeTextArea(); properlySourceSizeTextArea();