summaryrefslogtreecommitdiff
path: root/lib/scripts/edit.js
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-06-29 23:12:00 +0200
committerAndreas Gohr <andi@splitbrain.org>2009-06-29 23:12:00 +0200
commit8567cbc4fea121b3d779e70bda73fb3bbc6d5d3a (patch)
tree8ddd6e521f6463f02d5e7467b1badaef78f0dce2 /lib/scripts/edit.js
parent2efa3a2a596756f9ee1a987b10cd835717fdfe95 (diff)
downloadrpg-8567cbc4fea121b3d779e70bda73fb3bbc6d5d3a.tar.gz
rpg-8567cbc4fea121b3d779e70bda73fb3bbc6d5d3a.tar.bz2
fixed headline level detection
Ignore-this: 39675a7f375e3eb619228dbabda857ea This fixes incorrect headline headline level detetion when the text starts with a headline (eg. in most cases) darcs-hash:20090629211200-7ad00-d8a7cbe331806fcdbca70b5da188b387dc2c2a87.gz
Diffstat (limited to 'lib/scripts/edit.js')
-rw-r--r--lib/scripts/edit.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js
index 6c8e7f31c..267f51194 100644
--- a/lib/scripts/edit.js
+++ b/lib/scripts/edit.js
@@ -197,7 +197,7 @@ function addBtnActionAutohead(btn, props, edid, id)
function currentHeadlineLevel(textboxId){
var field = $(textboxId);
var selection = getSelection(field);
- var search = field.value.substr(0,selection.start);
+ var search = "\n"+field.value.substr(0,selection.start);
var lasthl = search.lastIndexOf("\n==");
if(lasthl == -1 && field.form.prefix){
// we need to look in prefix context