diff --git a/app/static/scripts/editor.js b/app/static/scripts/editor.js index 52633c2..ec3b790 100644 --- a/app/static/scripts/editor.js +++ b/app/static/scripts/editor.js @@ -107,9 +107,9 @@ function editor_set_title(event, level, diff) if(count < line.length && line[count] == ' ') contents_index++; let contents = line.slice(contents_index); - if(level > 0) { + if(level > 0 || count == 1 && diff == -1) { /* Remove the title if the corresponding level is re-requested */ - if(count == level) + if(count == level || count == 1 && diff == -1) return contents; /* Otherwise, add it */ else