From 8567cbc4fea121b3d779e70bda73fb3bbc6d5d3a Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 29 Jun 2009 23:12:00 +0200 Subject: 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 --- lib/scripts/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scripts') 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 -- cgit v1.2.3