mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-25 14:53:15 +00:00
Add new "htmlencodedplainwikified" format to view widget
Triggered by the text-slicer plugin, but general purpose. The clunky implementation shows the shortcomings of the view widget. It was one of the first widgets to be implemented; subsequently, the implementation of macros gives us a potentially more flexible way of implementing these kinds of text transformations.
This commit is contained in:
parent
eb9fb6635d
commit
939596bd47
|
@ -55,6 +55,9 @@ ViewWidget.prototype.execute = function() {
|
||||||
case "htmlwikified":
|
case "htmlwikified":
|
||||||
this.text = this.getValueAsHtmlWikified();
|
this.text = this.getValueAsHtmlWikified();
|
||||||
break;
|
break;
|
||||||
|
case "htmlencodedplainwikified":
|
||||||
|
this.text = this.getValueAsHtmlEncodedPlainWikified();
|
||||||
|
break;
|
||||||
case "htmlencoded":
|
case "htmlencoded":
|
||||||
this.text = this.getValueAsHtmlEncoded();
|
this.text = this.getValueAsHtmlEncoded();
|
||||||
break;
|
break;
|
||||||
|
@ -132,6 +135,10 @@ ViewWidget.prototype.getValueAsHtmlWikified = function() {
|
||||||
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
|
return this.wiki.renderText("text/html","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}));
|
||||||
|
};
|
||||||
|
|
||||||
ViewWidget.prototype.getValueAsHtmlEncoded = function() {
|
ViewWidget.prototype.getValueAsHtmlEncoded = function() {
|
||||||
return $tw.utils.htmlEncode(this.getValueAsText());
|
return $tw.utils.htmlEncode(this.getValueAsText());
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user