diff options
Diffstat (limited to 'vendor/oojs/oojs-ui/src/HtmlSnippet.js')
-rw-r--r-- | vendor/oojs/oojs-ui/src/HtmlSnippet.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/oojs/oojs-ui/src/HtmlSnippet.js b/vendor/oojs/oojs-ui/src/HtmlSnippet.js new file mode 100644 index 00000000..b9c5c314 --- /dev/null +++ b/vendor/oojs/oojs-ui/src/HtmlSnippet.js @@ -0,0 +1,29 @@ +/** + * Wraps an HTML snippet for use with configuration values which default + * to strings. This bypasses the default html-escaping done to string + * values. + * + * @class + * + * @constructor + * @param {string} [content] HTML content + */ +OO.ui.HtmlSnippet = function OoUiHtmlSnippet( content ) { + // Properties + this.content = content; +}; + +/* Setup */ + +OO.initClass( OO.ui.HtmlSnippet ); + +/* Methods */ + +/** + * Render into HTML. + * + * @return {string} Unchanged HTML snippet. + */ +OO.ui.HtmlSnippet.prototype.toString = function () { + return this.content; +}; |