diff --git a/core/modules/widgets/reveal.js b/core/modules/widgets/reveal.js index 2afa1d9ee..84f0b22e8 100755 --- a/core/modules/widgets/reveal.js +++ b/core/modules/widgets/reveal.js @@ -30,7 +30,11 @@ RevealWidget.prototype.render = function(parent,nextSibling) { this.parentDomNode = parent; this.computeAttributes(); this.execute(); - var domNode = this.document.createElement(this.parseTreeNode.isBlock ? "div" : "span"); + var tag = this.parseTreeNode.isBlock ? "div" : "span"; + if($tw.config.htmlUnsafeElements.indexOf(this.revealTag) === -1) { + tag = this.revealTag; + } + var domNode = this.document.createElement(tag); var classes = this["class"].split(" ") || []; classes.push("tc-reveal"); domNode.className = classes.join(" "); @@ -83,6 +87,7 @@ Compute the internal state of the widget RevealWidget.prototype.execute = function() { // Get our parameters this.state = this.getAttribute("state"); + this.revealTag = this.getAttribute("tag"); this.type = this.getAttribute("type"); this.text = this.getAttribute("text"); this.position = this.getAttribute("position"); diff --git a/editions/tw5.com/tiddlers/widgets/RevealWidget.tid b/editions/tw5.com/tiddlers/widgets/RevealWidget.tid index 3940e91a0..acc8898be 100644 --- a/editions/tw5.com/tiddlers/widgets/RevealWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/RevealWidget.tid @@ -1,5 +1,5 @@ created: 20131024141900000 -modified: 20140211232346858 +modified: 20150310124305795 tags: Widgets title: RevealWidget type: text/vnd.tiddlywiki @@ -19,6 +19,7 @@ The content of the `<$reveal>` widget is displayed according to the rules given |!Attribute |!Description | |state |The title of the tiddler containing the state | +|tag |Overrides the default HTML element tag (`