1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

Enhance text widget to optionally use "text" attribute

This lets us use the text widget to render text in macros that we don’t
want to be wikified.
This commit is contained in:
Jermolene 2014-01-19 21:45:55 +00:00
parent d5df78d979
commit 95cb99adb9
2 changed files with 18 additions and 1 deletions

View File

@ -28,8 +28,10 @@ Render this widget into the DOM
*/
TextNodeWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
var textNode = this.document.createTextNode(this.parseTreeNode.text);
var text = this.getAttribute("text",this.parseTreeNode.text),
textNode = this.document.createTextNode(text);
parent.insertBefore(textNode,nextSibling);
this.domNodes.push(textNode);
};

View File

@ -0,0 +1,15 @@
created: 201401191419
modified: 201401190837
tags: widget
title: TextWidget
! Introduction
The text widget displays plain text.
! Content and Attributes
The content of the `<$text>` widget is not used.
|!Attribute |!Description |
|text |The text to display |