Extend view widget with plainwikified format

This commit is contained in:
Jermolene
2016-06-23 16:28:59 +01:00
parent 28730caf7b
commit 3d5885f5a5
2 changed files with 18 additions and 6 deletions

View File

@@ -55,6 +55,9 @@ ViewWidget.prototype.execute = function() {
case "htmlwikified":
this.text = this.getValueAsHtmlWikified();
break;
case "plainwikified":
this.text = this.getValueAsPlainWikified();
break;
case "htmlencodedplainwikified":
this.text = this.getValueAsHtmlEncodedPlainWikified();
break;
@@ -135,6 +138,10 @@ ViewWidget.prototype.getValueAsHtmlWikified = function() {
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
};
ViewWidget.prototype.getValueAsPlainWikified = function() {
return this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
};
ViewWidget.prototype.getValueAsHtmlEncodedPlainWikified = function() {
return $tw.utils.htmlEncode(this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this}));
};