sachinchoolur / angular-trix

A rich WYSIWYG text editor directive for angularjs.
http://sachinchoolur.github.io/angular-trix/
MIT License
328 stars 62 forks source link

insertHTML unwanted break / div #6

Open davisonn opened 8 years ago

davisonn commented 8 years ago

I want the editor to initialize as a bulleted list, but am having the following issue: (note: I have the toolbar hidden since it takes up too much space for my uses)

  1. Inserting a ul
$scope.trixInitialize = function(e, editor) {
  editor.setSelectedRange([0,0]);
  editor.insertHTML('<ul><li></li></ul>');
}

results in a list followed by an empty div: <ul><li><!--block--><br></li></ul><div><!--block--><br></div>

  1. I would expect the list to be inserted inside the div like insertString:
$scope.trixInitialize = function(e, editor) {
  editor.setSelectedRange([0,0]);
  editor.insertString('Hello World');
}

<div><!--block-->Hello World</div>

Am I missing something?

shashankGopannagari commented 6 years ago

can anyone help me on this