Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 8ae5ad8

Browse files
vranajoeltine
authored andcommitted
Treat string in goog.ui.Bubble as plain text.
RELNOTES[INC]: Breaking change for third parties: This will introduce double-escaping if your code passes a string with HTML code to goog.ui.Bubble. Pass SafeHtml instead. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=112188347
1 parent 0af8916 commit 8ae5ad8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

closure/goog/deps.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

closure/goog/ui/bubble.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ goog.require('goog.dom.safe');
2828
goog.require('goog.events');
2929
goog.require('goog.events.EventType');
3030
goog.require('goog.html.SafeHtml');
31-
goog.require('goog.html.legacyconversions');
3231
goog.require('goog.math.Box');
3332
goog.require('goog.positioning');
3433
goog.require('goog.positioning.AbsolutePosition');
@@ -50,10 +49,9 @@ var SafeHtml = goog.html.SafeHtml;
5049
* The Bubble provides a general purpose bubble implementation that can be
5150
* anchored to a particular element and displayed for a period of time.
5251
*
53-
* @param {string|!goog.html.SafeHtml|Element} message HTML or an element
54-
* to display inside the bubble. If possible pass a SafeHtml; string
55-
* is supported for backwards-compatibility only and uses
56-
* goog.html.legacyconversions.
52+
* @param {string|!goog.html.SafeHtml|?Element} message Message or an element
53+
* to display inside the bubble. Strings are treated as plain-text and will
54+
* be HTML escaped.
5755
* @param {Object=} opt_config The configuration
5856
* for the bubble. If not specified, the default configuration will be
5957
* used. {@see goog.ui.Bubble.defaultConfig}.
@@ -65,7 +63,7 @@ goog.ui.Bubble = function(message, opt_config, opt_domHelper) {
6563
goog.ui.Component.call(this, opt_domHelper);
6664

6765
if (goog.isString(message)) {
68-
message = goog.html.legacyconversions.safeHtmlFromString(message);
66+
message = goog.html.SafeHtml.htmlEscape(message);
6967
}
7068

7169
/**

0 commit comments

Comments
 (0)