mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Fix converting OL <-> UL
This commit is contained in:
parent
8e843a1afc
commit
e517f1505b
3 changed files with 14 additions and 8 deletions
|
@ -3715,8 +3715,11 @@ var makeList = function ( self, frag, type ) {
|
|||
listItemAttrs = tagAttributes.li;
|
||||
|
||||
while ( node = walker.nextNode() ) {
|
||||
tag = node.parentNode.nodeName;
|
||||
if ( tag !== 'LI' ) {
|
||||
if ( node.parentNode.nodeName === 'LI' ) {
|
||||
node = node.parentNode;
|
||||
walker.currentNode = node.lastChild;
|
||||
}
|
||||
if ( node.nodeName !== 'LI' ) {
|
||||
newLi = self.createElement( 'LI', listItemAttrs );
|
||||
if ( node.dir ) {
|
||||
newLi.dir = node.dir;
|
||||
|
@ -3739,7 +3742,7 @@ var makeList = function ( self, frag, type ) {
|
|||
newLi.appendChild( empty( node ) );
|
||||
walker.currentNode = newLi;
|
||||
} else {
|
||||
node = node.parentNode.parentNode;
|
||||
node = node.parentNode;
|
||||
tag = node.nodeName;
|
||||
if ( tag !== type && ( /^[OU]L$/.test( tag ) ) ) {
|
||||
replaceWith( node,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1360,8 +1360,11 @@ var makeList = function ( self, frag, type ) {
|
|||
listItemAttrs = tagAttributes.li;
|
||||
|
||||
while ( node = walker.nextNode() ) {
|
||||
tag = node.parentNode.nodeName;
|
||||
if ( tag !== 'LI' ) {
|
||||
if ( node.parentNode.nodeName === 'LI' ) {
|
||||
node = node.parentNode;
|
||||
walker.currentNode = node.lastChild;
|
||||
}
|
||||
if ( node.nodeName !== 'LI' ) {
|
||||
newLi = self.createElement( 'LI', listItemAttrs );
|
||||
if ( node.dir ) {
|
||||
newLi.dir = node.dir;
|
||||
|
@ -1384,7 +1387,7 @@ var makeList = function ( self, frag, type ) {
|
|||
newLi.appendChild( empty( node ) );
|
||||
walker.currentNode = newLi;
|
||||
} else {
|
||||
node = node.parentNode.parentNode;
|
||||
node = node.parentNode;
|
||||
tag = node.nodeName;
|
||||
if ( tag !== type && ( /^[OU]L$/.test( tag ) ) ) {
|
||||
replaceWith( node,
|
||||
|
|
Loading…
Reference in a new issue