Open Nessworthy opened 8 years ago
It's pretty easy, I'll push something soon.
It's a private repository but collaborators should have access: https://github.com/kelunik/php-highlight
We already use class names in the user notes instead of inline styles. Well, kind of pretty hacky. https://github.com/php/web-php/blob/36168258a227b83926341c37eec0c151f8335b6e/include/layout.inc#L14-L49
Hi!
I'd like to pipe, if I could. As I also thought about that, let me summarise what I found:
1) I'm going to add something like ClientSideHighlighter
in next stable version of PhD. A highlighter class which would return valid wrappers possible to be handled by projects like prism.js
2) It will be shameless advertisement of a project written by a friend of mine, but I'd like to mention it, just to get you know what our options are. There is a modern, but also very fast (more than 2x faster than GeSHi on every tested case... if only GeSHi means everything and still can be used as a reference today). https://github.com/kadet1090/keylighter (it has minimal requirement of PHP 5.5 and for why is that important, see below)
3) And now, the sad part comes. PHP version requirements:
highlight_string()
for the manual notes - it would be acceptable IMO, as notes doesn't have any kind of tags enclosing code snippets except for PHP tags. Which are very often unclosed and have text inside. And fixing 25k notes is a no-go. Actually, I don't know about other client-side highlighters but prism.js
wouldn't be able to highlight them as well.So those are my 2cts (and, yeah, I kinda like nested lists...)
Discussion points:
Other points to consider: