I noticed that it adds an span whenever you have a blank line in the html.
This was messing up some styling I had done on my tiddly wiki so I modified
the function to remove the empty spans and thought I'd share it. If anyone
knows a way to keep it from surrounding everything in spans in the first
place, that'd be cool.
// wikify #text nodes that remain after HTML content is processed
(pre-order recursion)
function wikifyTextNodes(theNode,w)
{
function unmask(s) { return
s.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(/\\n/g,'\n'); }
switch (theNode.nodeName.toLowerCase()) {
case 'style': case 'option': case 'select':
theNode.innerHTML=unmask(theNode.innerHTML);
break;
case 'textarea':
theNode.value=unmask(theNode.value);
break;
case '#text':
var txt=unmask(theNode.nodeValue);
//var newNode=createTiddlyElement(null, "#text");
var newNode=createTiddlyElement(null,"span");
theNode.parentNode.replaceChild(newNode,theNode);
wikify(txt,newNode,highlightHack,w.tiddler);
jQuery(newNode).filter(function() {
return jQuery.trim(jQuery(this).html()) === "";
}).remove(); // remove them
break;
default:
for (var i=0;i<theNode.childNodes.length;i++)
wikifyTextNodes(theNode.childNodes.item(i),w); // recursion
break;
}
}
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.