minor sanitization for post editing
This commit is contained in:
parent
fdf7643f08
commit
34b96f49de
|
@ -83,6 +83,9 @@ def update_post(data):
|
|||
return
|
||||
|
||||
post = data["post"]
|
||||
post = post.strip().replace("<br>", "<br />")
|
||||
data["post"] = post
|
||||
|
||||
post_id = data["post_id"]
|
||||
db.update_quest_post(post_id, post)
|
||||
emit("update_post", data, room=room)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
{% block head %}
|
||||
<script type="text/javascript" src="/static/socket.io.slim.js"></script>
|
||||
<script>
|
||||
document.execCommand("defaultParagraphSeparator", false, "br");
|
||||
var socket;
|
||||
var tid = setInterval( function () {
|
||||
if ( document.readyState !== 'complete' ) return;
|
||||
|
@ -61,7 +62,8 @@
|
|||
}
|
||||
function edit_post(post_id) {
|
||||
document.getElementById('questPostData-' + post_id).contentEditable = 'true';
|
||||
document.getElementById('questPostData-' + post_id).style.border = '1px solid #ccc'
|
||||
document.execCommand("defaultParagraphSeparator", false, "br");
|
||||
document.getElementById('questPostData-' + post_id).style.border = '1px solid #ccc';
|
||||
document.getElementById('savePost-' + post_id).style.display = 'initial';
|
||||
}
|
||||
function save_post(post_id) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user