mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 13:16:31 -05:00
Style pass
This commit is contained in:
parent
29fffdccd0
commit
b4d47775b9
4 changed files with 17 additions and 15 deletions
|
@ -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
|
@ -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' } ),
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue