Skip to content

Commit

Permalink
docs: Further explanation for why .normalize() is optional (#7105)
Browse files Browse the repository at this point in the history
  • Loading branch information
tofumatt authored and noisysocks committed Jun 4, 2018
1 parent b8c1f6d commit 6a7085b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions blocks/api/raw-handling/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ export default function rawHandler( { HTML = '', plainText = '', mode = 'AUTO',
}

// Normalize unicode to use composed characters.
// Unsupported in IE.
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
// See https://core.trac.wordpress.org/ticket/30130
// This is unsupported in IE 11 but it's a nice-to-have feature, not mandatory.
// Not normalizing the content will only affect older browsers and won't
// entirely break the app.
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
// See: https://core.trac.wordpress.org/ticket/30130
// See: https://github.com/WordPress/gutenberg/pull/6983#pullrequestreview-125151075
if ( String.prototype.normalize ) {
HTML = HTML.normalize();
}
Expand Down

0 comments on commit 6a7085b

Please sign in to comment.