mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-08-30 22:58:56 +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:
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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 |
|
||||
Reference in New Issue
Block a user