diff --git a/core/modules/new_widgets/view.js b/core/modules/new_widgets/view.js index 5294b8e15..b87a8a088 100755 --- a/core/modules/new_widgets/view.js +++ b/core/modules/new_widgets/view.js @@ -61,6 +61,9 @@ ViewWidget.prototype.execute = function() { case "relativedate": this.text = this.getValueAsRelativeDate(); break; + case "stripcomments": + this.text = this.getValueAsStrippedComments(); + break; default: // "text" this.text = this.getValueAsText(); break; @@ -138,6 +141,18 @@ ViewWidget.prototype.getValueAsRelativeDate = function(format) { } }; +ViewWidget.prototype.getValueAsStrippedComments = function() { + var lines = this.getValueAsText().split("\n"), + out = []; + for(var line=0; line