0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 13:16:31 -05:00

Style pass

This commit is contained in:
Gert K. Sønderby 2015-11-25 15:58:51 +01:00 committed by Gert Sønderby
parent 29fffdccd0
commit b4d47775b9
4 changed files with 17 additions and 15 deletions

View file

@ -1326,7 +1326,7 @@ var keyHandlers = {
return; return;
} }
if ( /^PRE|CODE|SAMP$/.test( block.nodeName ) ) { if ( block.nodeName === 'PRE' ) {
if ( !getNodeAfter( range.endContainer, range.endOffset ).nodeValue[ range.endOffset ] ) { if ( !getNodeAfter( range.endContainer, range.endOffset ).nodeValue[ range.endOffset ] ) {
insertNodeInRange( range, self._doc.createTextNode( '\n\n' ) ); insertNodeInRange( range, self._doc.createTextNode( '\n\n' ) );
} else { } else {
@ -3554,7 +3554,8 @@ var getTextFromHTMLFragment = function ( self, frag ) {
var makePreformatted = function ( frag ) { var makePreformatted = function ( frag ) {
return this.createElement( 'PRE', return this.createElement( 'PRE',
this._config.tagAttributes.pre, [ this._config.tagAttributes.pre,
[
this.createElement( 'INPUT', { id: startSelectionId, type: 'hidden' } ), this.createElement( 'INPUT', { id: startSelectionId, type: 'hidden' } ),
getTextFromHTMLFragment( this, frag ), getTextFromHTMLFragment( this, frag ),
this.createElement( 'INPUT', { id: endSelectionId, type: 'hidden' } ), this.createElement( 'INPUT', { id: endSelectionId, type: 'hidden' } ),

File diff suppressed because one or more lines are too long

View file

@ -1351,7 +1351,8 @@ var getTextFromHTMLFragment = function ( self, frag ) {
var makePreformatted = function ( frag ) { var makePreformatted = function ( frag ) {
return this.createElement( 'PRE', return this.createElement( 'PRE',
this._config.tagAttributes.pre, [ this._config.tagAttributes.pre,
[
this.createElement( 'INPUT', { id: startSelectionId, type: 'hidden' } ), this.createElement( 'INPUT', { id: startSelectionId, type: 'hidden' } ),
getTextFromHTMLFragment( this, frag ), getTextFromHTMLFragment( this, frag ),
this.createElement( 'INPUT', { id: endSelectionId, type: 'hidden' } ), this.createElement( 'INPUT', { id: endSelectionId, type: 'hidden' } ),

View file

@ -175,7 +175,7 @@ var keyHandlers = {
return; return;
} }
if ( /^PRE|CODE|SAMP$/.test( block.nodeName ) ) { if ( block.nodeName === 'PRE' ) {
if ( !getNodeAfter( range.endContainer, range.endOffset ).nodeValue[ range.endOffset ] ) { if ( !getNodeAfter( range.endContainer, range.endOffset ).nodeValue[ range.endOffset ] ) {
insertNodeInRange( range, self._doc.createTextNode( '\n\n' ) ); insertNodeInRange( range, self._doc.createTextNode( '\n\n' ) );
} else { } else {