I am working with the editor control and I am providing a few buttons that will allow the user to insert some pre-defined HTML content. This is easy enough to do using the pasteHtml method but it isn't pasting all of the HTML text I'm passing into it. There are some comments I've added to these snippets so that I can tell if the code was auto-inserted in case there are issues in the future and troubleshooting needs to be done on the pages the editor is generating. I have noticed that if I am in HTML view that the comment is pasted as expected but not when I am in Design view. The people who use this tool know little/nothing about editing raw HTML so I cannot count on them to use the HTML view to insert comments (in fact we are considering disabling editing in HTML view per the KB article).
For example, we have lists that contains a fairly standard sets of bullet points that the users would like to just click a button to insert into a document. I would like to insert something like this:
It will get pasted into the editor widow with the following HTML
As you can see, the second comment is included in the pasted HTML but the opening comment is not. Additionally, the editor has inserted a <p> around the second comment and has inherited the styles of the paragraph where the cursor was located when the paste opperation was completed. Is there a workaround for this so that the opening comment will be pasted into the window and a way to prevent the paragraph from being placed around the second one?
For example, we have lists that contains a fairly standard sets of bullet points that the users would like to just click a button to insert into a document. I would like to insert something like this:
<!-- Below UL Auto Inserted -->
<
UL
>
<
LI
>Item 1</
LI
>
<
LI
>Item 2</
LI
>
<
LI
>Item 3</
LI
>
</
UL
>
<!-- Above UL Auto Inserted -->
It will get pasted into the editor widow with the following HTML
<
p
> </
p
>
<
ul
>
<
li
>Item 1</
li
>
<
li
>Item 2</
li
>
<
li
>Item 3</
li
>
</
ul
>
<
p
style
=
"text-align: left;"
class
=
"style20"
>
<!-- Above UL Auto Inserted -->
</
p
>
As you can see, the second comment is included in the pasted HTML but the opening comment is not. Additionally, the editor has inserted a <p> around the second comment and has inherited the styles of the paragraph where the cursor was located when the paste opperation was completed. Is there a workaround for this so that the opening comment will be pasted into the window and a way to prevent the paragraph from being placed around the second one?