Preserve htmlspecial characters in task description
authorJoey Schulze <joey@infodrom.org>
Mon, 20 Jun 2016 11:50:06 +0000 (13:50 +0200)
committerJoey Schulze <joey@infodrom.org>
Mon, 20 Jun 2016 11:50:06 +0000 (13:50 +0200)
src/InfoCon/stempel/status.wml

index 9e738b6..d52c94d 100644 (file)
@@ -263,14 +263,13 @@ function edit_task(obj)
        task_title = obj.innerHTML;
        task_oid = obj.parentNode.children[0].children[0].value;
 
        task_title = obj.innerHTML;
        task_oid = obj.parentNode.children[0].children[0].value;
 
-       var input = document.createElement('input');
-       input.value = obj.innerHTML
-       input.style.fontSize = '100%';
-       input.style.width = '100%';
-       input.style.background = 'yellow';
-
+       var input = $('<input>');
+<protect>
+       input.val(obj.innerHTML.replace('&gt;', '>').replace('&lt;', '<').replace('&amp;', '&'));
+</protect>
+       input.css('fontSize', '100%').css('width', '100%').css('background', 'yellow');
        obj.innerHTML = '';
        obj.innerHTML = '';
-       obj.appendChild(input);
+       $(obj).append(input);
        input.focus();
     }
 }
        input.focus();
     }
 }