well, I wouldn't do "tag-guessing", I would just put something around blocks of code, and not worry about tags at all. encasing code in [php][/php] or something similar will allow us to not bother over missing ?>, etc, as the highlighting will stop at [/php]. (besides, its a "feature" to leave off ?> :) It will be a lot easier to write a script to add in encasing blocks, rather than fix and/or add missing tags. As for fixing missing " ' etc, atleast the highlighting will stop at [/php], and not pollute the entire note. We can manage notes as we find them, or leave them broken ( eg don't go through the manual throwing in missing quotations and such; either remove bad notes or leave them alone ) now that its not a huge problem.agreed, just wanted to point it out regardless, just in case. Another
thing i've seen is that syntax highlighting in user notes has made almost all notes containing code fubar. People just won't stick proper
code in them. I hate to say it, but there needs to be something like
[php][/php] for code examples in notes. Most cases of the notes being
fubar are caused by people leaving quotes unquoted (no ending quotation), and neglecting the ending ?> tag.
I have also noticed it. I have started to write a script to add missing tags around the blocks of a code. Despite I tried couple of approaches I realized that it's hardly possible to made it fully automatic (mainly because of syntax errors and misspells). I think it will be nice to add this tag-guessing to preview in submitting note.
It will be also nice to add missing tags to current notes and I'm a volunteer for it. But before it, it will be nice to delete or reject some of 8577 existing notes.
Jakub Vrana
Jakub Vrana wrote:
- [PHP-DOC] Syntax Highlighted Examples Derek Ford
- Re: [PHP-DOC] Syntax Highlighted Examples Jakub Vrana
- Re: [PHP-DOC] Syntax Highlighted Examples Gabor Hojtsy
- Re: [PHP-DOC] Syntax Highlighted Examples Derek Ford
- Re: [PHP-DOC] Syntax Highlighted Examples Jakub Vrana
- Re: [PHP-DOC] Syntax Highlighted Examples Derek Ford
- Re: [PHP-DOC] Syntax Highlighted Exampl... Jakub Vrana
- Re: [PHP-DOC] Syntax Highlighted Ex... Gabor Hojtsy
- Re: [PHP-DOC] Syntax Highlighte... Jakub Vrana