mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Code style fixup
This commit is contained in:
parent
9eacfb7b22
commit
632aae016b
3 changed files with 17 additions and 9 deletions
|
@ -4201,6 +4201,14 @@ proto.insertHTML = function ( html, isPaste ) {
|
|||
html = html.slice( startFragmentIndex + 20, endFragmentIndex );
|
||||
}
|
||||
}
|
||||
// Wrap with <tr> if html contains dangling <td> tags
|
||||
if ( /<\/td>((?!<\/tr>)[\s\S])*$/i.test( html ) ) {
|
||||
html = '<TR>' + html + '</TR>';
|
||||
}
|
||||
// Wrap with <table> if html contains dangling <tr> tags
|
||||
if ( /<\/tr>((?!<\/table>)[\s\S])*$/i.test( html ) ) {
|
||||
html = '<TABLE>' + html + '</TABLE>';
|
||||
}
|
||||
// Parse HTML into DOM tree
|
||||
div = this.createElement( 'DIV' );
|
||||
div.innerHTML = html;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1747,16 +1747,16 @@ proto.insertHTML = function ( html, isPaste ) {
|
|||
html = html.slice( startFragmentIndex + 20, endFragmentIndex );
|
||||
}
|
||||
}
|
||||
// Parse HTML into DOM tree
|
||||
div = this.createElement( 'DIV' );
|
||||
// wrap with tr if html contains dangling td tags
|
||||
if (html.match(/<\/td>((?!<\/tr>)[\s\S])*$/i)) {
|
||||
// Wrap with <tr> if html contains dangling <td> tags
|
||||
if ( /<\/td>((?!<\/tr>)[\s\S])*$/i.test( html ) ) {
|
||||
html = '<TR>' + html + '</TR>';
|
||||
}
|
||||
// wrap with table if html contains dangling tr tags
|
||||
if (html.match(/<\/tr>((?!<\/table>)[\s\S])*$/i)) {
|
||||
// Wrap with <table> if html contains dangling <tr> tags
|
||||
if ( /<\/tr>((?!<\/table>)[\s\S])*$/i.test( html ) ) {
|
||||
html = '<TABLE>' + html + '</TABLE>';
|
||||
}
|
||||
}
|
||||
// Parse HTML into DOM tree
|
||||
div = this.createElement( 'DIV' );
|
||||
div.innerHTML = html;
|
||||
frag = doc.createDocumentFragment();
|
||||
frag.appendChild( empty( div ) );
|
||||
|
|
Loading…
Reference in a new issue