Friday, March 13, 2009

Highlighter status

I just added Python support, as per Tong's request. It now supports html, xml, javascript, php, css, perl, ruby, c, c++, c#, java, scala, haxe, python, haskell, latex, plus a few obscure languages. Admittedly, the support is pretty weak for some of the languages, like c, c++ and c#.

11 comments:

Anonymous said...

Thanks!! .. i'll upgrade my pasteboard app as soon as possible.

Anonymous said...

Another suggestion:
The languages array field should be public and typed.
I am in need to iterate over to check if a language is available.

Ahnfelt said...

Thank you for the suggestion. You can now get a list of supported languages via getLanguages(): Array<Array<String>>.

Ahnfelt said...

It seems that the line numbers are broken:

http://paste.disktree.net/18

I wonder why that is. It looks like it can't count lines correctly... duh.

Ahnfelt said...

That's odd, it works fine when I test it locally, and there's nothing obviously wrong with the code.

Tong, maybe you have a better idea of what's going on?

Ahnfelt said...

Small update: hexadecimal fix and possibly a line number fix.

Ahnfelt said...

Small update: added a null rule for nested rules that don't have a stop token. Instead, they stop at the first token not matched by the nested language.

tong said...

I am using your class in a web based chatroom with inline syntax highlighting here: http://disktree.spektral.at/hxchat/
..works like a charm. thanks a lot, again. ;)

Friv3 said...

Keep on writing, great job! This content is written very well. Yoob 100 Games Your use of formatting when making your points makes your observations very clear and easy to understand.Moto X3M3 hacked Thank you.
Friv3 Player

Linda said...

Thank you for such a sweet tutorial - all this time later, I've found it and love the end result. I appreciate the time you spent sharing your skills.
sushi-cat2.com

Unknown said...

Not all are true. Everyone has their own way of thinking but I think they have to reconsider. I like to argue for the most accurate results.
http://www.facebookbaixargratis.com.br