Ticket #1084 (closed defect: fixed)
createTiddlyText regression
| Reported by: | proppy | Owned by: | MartinBudden |
|---|---|---|---|
| Priority: | undefined | Milestone: | 2.5.3 |
| Component: | core | Version: | |
| Severity: | undefined | Keywords: | |
| Cc: |
Description
Hi,
I think Jayfresh and I spotted a regression in jquery implemention of createTiddlyText: function createTiddlyText(parent,text) {
return jQuery(parent).append(text);
} returns the parent instead of the created element. Althought is given "<div>" as text argument it will create html <div></div> instead of a text node with '<div>' as content.
This as the side effect of breaking TiddlyTemplating? stuff: when using a template: <div><!--<<viewer text>>--></div> expands to: <div></div>text instead of: <div>text</div>
Would you consider reverting to the previous implementation ? function createTiddlyText(theParent,theText) {
return theParent.appendChild(document.createTextNode(theText));
}
#jquery guys told me that jquery provide no good way to manipulate text node directly. I attached a patch, that add a test to the qunit test suite to reproduce the issue, and revert to the createTiddlyText previous implementation.

