Detect if cursor is within li on content editable

NepPhamma

New Member
I have working code that inserts \[code\]<br>\[/code\] when you hit enter in a content editable div. (Browsers have various defaults of inserting \[code\]<div>\[/code\] or \[code\]<p>\[/code\] instead)The problem is that it kills the default behavior of hitting enter to add another list item when building ordered or unordered lists. So my question is, can you detect if the karet is within a list item, and if so, disable the javascript that deals with the enter key?Working code: http://jsfiddle.net/kthornbloom/RCdhS/
 
Back
Top