mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Fix typo and whitespace issues
This commit is contained in:
parent
c5a7c622fe
commit
ede1991931
1 changed files with 6 additions and 6 deletions
|
@ -1965,11 +1965,11 @@ proto.insertHTML = function ( html, isPaste ) {
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
var escapeHTMLFragement = function ( text ) {
|
var escapeHTML = function ( text ) {
|
||||||
return text.split( '&' ).join( '&' )
|
return text.split( '&' ).join( '&' )
|
||||||
.split( '<' ).join( '<' )
|
.split( '<' ).join( '<' )
|
||||||
.split( '>' ).join( '>' )
|
.split( '>' ).join( '>' )
|
||||||
.split( '"' ).join( '"' );
|
.split( '"' ).join( '"' );
|
||||||
};
|
};
|
||||||
|
|
||||||
proto.insertPlainText = function ( plainText, isPaste ) {
|
proto.insertPlainText = function ( plainText, isPaste ) {
|
||||||
|
@ -2015,14 +2015,14 @@ proto.insertPlainText = function ( plainText, isPaste ) {
|
||||||
|
|
||||||
for ( attr in attributes ) {
|
for ( attr in attributes ) {
|
||||||
openBlock += ' ' + attr + '="' +
|
openBlock += ' ' + attr + '="' +
|
||||||
escapeHTMLFragement( attributes[ attr ] ) +
|
escapeHTML( attributes[ attr ] ) +
|
||||||
'"';
|
'"';
|
||||||
}
|
}
|
||||||
openBlock += '>';
|
openBlock += '>';
|
||||||
|
|
||||||
for ( i = 0, l = lines.length; i < l; i += 1 ) {
|
for ( i = 0, l = lines.length; i < l; i += 1 ) {
|
||||||
line = lines[i];
|
line = lines[i];
|
||||||
line = escapeHTMLFragement( line ).replace( / (?= )/g, ' ' );
|
line = escapeHTML( line ).replace( / (?= )/g, ' ' );
|
||||||
// Wrap each line in <div></div>
|
// Wrap each line in <div></div>
|
||||||
lines[i] = openBlock + ( line || '<BR>' ) + closeBlock;
|
lines[i] = openBlock + ( line || '<BR>' ) + closeBlock;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue