Index: _source/core/htmlparser/basicwriter.js
===================================================================
--- _source/core/htmlparser/basicwriter.js (revision 5242)
+++ _source/core/htmlparser/basicwriter.js (working copy)
@@ -60,9 +60,10 @@
*/
attribute : function( attName, attValue )
{
- // Browsers don't always escape quote in attribute values. (#4683)
- if ( typeof attValue == 'string' )
- attValue = attValue.replace( /"/g, '"' );
+ // Browsers don't always escape special character in attribute values. (#4683, #4719).
+ if ( typeof attValue == 'string' ) {
+ attValue = attValue.replace( /"/g, '"' ).replace( //, '>' ).replace( /'/, ''' );
+ }
this._.output.push( ' ', attName, '="', attValue, '"' );
},
Index: _source/plugins/htmlwriter/plugin.js
===================================================================
--- _source/plugins/htmlwriter/plugin.js (revision 5242)
+++ _source/plugins/htmlwriter/plugin.js (working copy)
@@ -175,8 +175,8 @@
if ( typeof attValue == 'string' )
{
this.forceSimpleAmpersand && ( attValue = attValue.replace( /&/g, '&' ) );
- // Browsers don't always escape quote in attribute values. (#4683)
- attValue = attValue.replace( /"/g, '"' );
+ // Browsers don't always escape special character in attribute values. (#4683, #4719).
+ attValue = attValue.replace( /"/g, '"' ).replace( //, '>' ).replace( /'/, ''' );
}
this._.output.push( ' ', attName, '="', attValue, '"' );