|
HomeNewsExamplesDemoDownloadsFAQDocumentationMailing ListsLicense | |||||||||
9:45 am GMT
GeSHi NewsHere's where you can find out all the latest news about GeSHi - new releases, bug fixes and general errata. Engine of 1.2.X Largely Finished05/01/2005A happy new year to all of you who use GeSHi :). Though while I might have been slacking around, I have instead been working on GeSHi 1.2.X, and I now have a progress report for you all :). The GeSHi 1.2.X engine is largely completed now, with an approximate tripling of speed, sometimes better, for simple sources. But the best gains have been in the following areas: 1) Much better highlighting: You thought it was good before? Think again! The new engine handles any source code far better than ever before. And due to the way everything is set up, it is now easy to have multiple languages embedded in one source highlighting - for example PHP within HTML - and each language is highlightedd correctly. Furthermore, it handles such things as ?> enders in // comments for PHP much better. Here's a demo of what I mean. Firstly, this is a file that I use for testing highlighted with GeSHi 1.0.4, using standard (non-strict) mode: here. That's sorta bad, eh? For one thing, the <?php never seems to be highlighted, and it doesn't catch that the last single-line comment before the main block of HTML has a close-PHP (?>) in it that should stop highlighting of the single comment. Now here's the equivilant using the new parser. Strict mode off, and no attempt to highlight the HTML for starters: here. Now that looks sorta bad as well, but that's because the source that we're giving it to highlight is not exactly pure PHP. At least it caught the ?> trick, and were you noticing the time? Twice as fast! Here's another go at the same page. This time, we will use strict mode, and things should be much better. Here it is using GeSHi 1.0.4: here. Well quite simply, that's poor. It seemed to bail out around the multiline comment with ?> in it, and hardly did any highlighting at all, not to mention move the doctype declaration down a line without us asking. How about the new parser? here... Well how about that? Twice as fast, *and* highlighted everything correctly! Now let's try the page, but now we'll use the new parser and full PHP-with-HTML-embedded parsing: here... Are you drooling yet? ;). The CSS is highlighted, javascript inside HTML strings is highlighted - and all at the same speed as the best the old parser could do (which, if you recall, highlighted less than half the source correctly!) Here's another set of examples, using the source from a well known open-source project: Old parser, non-strict New parser, non-strict Old parser, strict New parser, strict New parser, full Note the improved times and improved highlighting! |