diff --git a/packages/escape-html/src/index.js b/packages/escape-html/src/index.js index 0b4e99941a41e..038e854d72194 100644 --- a/packages/escape-html/src/index.js +++ b/packages/escape-html/src/index.js @@ -58,7 +58,7 @@ export function escapeLessThan( value ) { * * @return {string} Escaped string. */ -export function escapeGreaterThan( value ) { +export function __unstableEscapeGreaterThan( value ) { return value.replace( />/g, '>' ); } @@ -74,7 +74,7 @@ export function escapeGreaterThan( value ) { * split HTML strings. This is a WordPress specific fix * * Note that if a resolution for Trac#45387 comes to fruition, it is no longer - * necessary for `escapeGreaterThan` to exist in this module. + * necessary for `__unstableEscapeGreaterThan` to exist in this module. * * See: https://core.trac.wordpress.org/ticket/45387 * @param {string} value Attribute value. @@ -82,7 +82,7 @@ export function escapeGreaterThan( value ) { * @return {string} Escaped attribute value. */ export function escapeAttribute( value ) { - return escapeGreaterThan( escapeQuotationMark( escapeAmpersand( value ) ) ); + return __unstableEscapeGreaterThan( escapeQuotationMark( escapeAmpersand( value ) ) ); } /** diff --git a/packages/escape-html/src/test/index.js b/packages/escape-html/src/test/index.js index 60a35126d0463..f6a3404dc9278 100644 --- a/packages/escape-html/src/test/index.js +++ b/packages/escape-html/src/test/index.js @@ -5,13 +5,13 @@ import { escapeAmpersand, escapeQuotationMark, escapeLessThan, - escapeGreaterThan, + __unstableEscapeGreaterThan, escapeAttribute, escapeHTML, isValidAttributeName, } from '../'; -function testEscapeGreaterThan( implementation ) { +function testUnstableEscapeGreaterThan( implementation ) { it( 'should escape greater than', () => { const result = implementation( 'Chicken > Ribs' ); expect( result ).toBe( 'Chicken > Ribs' ); @@ -55,13 +55,13 @@ describe( 'escapeLessThan', () => { } ); describe( 'escapeGreaterThan', () => { - testEscapeGreaterThan( escapeGreaterThan ); + testUnstableEscapeGreaterThan( __unstableEscapeGreaterThan ); } ); describe( 'escapeAttribute', () => { testEscapeAmpersand( escapeAttribute ); testEscapeQuotationMark( escapeAttribute ); - testEscapeGreaterThan( escapeAttribute ); + testUnstableEscapeGreaterThan( escapeAttribute ); } ); describe( 'escapeHTML', () => {