I did it!

But using a slightly different approach.

What I did is wrap each line withi a span but keeping the line break out of 
it. This is an example:
or(var i=0,line;i<lines.length;i++){
            line=lines[i];
              codeNode.appendChild(wrapInSpan(line));
              codeNode.appendChild(self.document.createTextNode("\n"));
        }

Then I highlight the whole code block. This replaces the code node with a 
new one, so  you have to grab the new one. Then you have a big collection 
of span nodes containing higlighted code. If you access the children of the 
code node you will get an array of only span nodes since the line breaks 
are not considerend children but plain text.
Then is just a matter of wrapping those elements whatever you want.

Now I have my code properly highlighted with a bunch of custom features 
such as line hidding, line bookmarks, zebra, on hover highlight, user token 
highlight....

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to