Use document.execCommand ('InsertUnorderedList') to format the outer tag

use document.execCommand ("InsertUnorderedList") to set an unordered list for a paragraph of text, but the outer label is removed.
this will cause the styles on these tags to be gone. Is there any way to add the li tag on the outermost layer instead of deleting the original tag?

original structure:

clipboard.png

document.execCommand( "InsertUnorderedList" ):

clipboard.png

Jun.18,2022
Menu