mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-03 20:59:09 +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:
parent
d5df78d979
commit
95cb99adb9
@ -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);
|
||||
};
|
||||
|
15
editions/tw5.com/tiddlers/widgets/TextWidget.tid
Normal file
15
editions/tw5.com/tiddlers/widgets/TextWidget.tid
Normal 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 |
|
Loading…
Reference in New Issue
Block a user