The attached context diff contains fixes for the source file wikiPage.php, with these changes:
- Now accepts "JPG", "PNG", etc., in uppercase as image names. No longer accepts "tif" or "tiff"--that's not an appropriate format for web images, so they'll just be rendered as links.
- Removes HTML comments from wiki text before rendering, so they can be used to leave comments _about_ the wiki text.
- Major reworking of the code that handles p/pre/ol/ul/dl. Old code basically ripped out and replaced; now produces clean HTML, compact dls, handles nesting better, etc. I've tested this pretty extensively on my own server without problems, but it is a major change, so you might want to schedule installation for a time when Jimbo or Jason is available to roll it back if I missed something.
Is there a tool that will reformat PHP code the way "indent" does for C code? This code is a real mess in places.
perl mode in emacs doesn't do too bad a job here... PHP is close enough in syntax to perl for it to work fairly well (cperl-mode is too smart for PHP)...
emacs filename ALT-x perl-mode #sets the mode to cperl CTRL-SPACE #this sets the "mark" SHIFT-ALT-> #moves the "point" to the end of the buffer SHIFT-ALT-\ #indents the region between the "mark" and the "point"
I beleive that these are all default key-bindings. People who care may argue that "ALT" should be "META" (or ESCAPE). This may not do what you want, so you can always SHIFT-CTRL-_ to undo (note that I press shift before CTRL, it matters somehow).
Please don't flame me for using emacs (or describing funtionality so poorly)...
Jason Richey
Lee Daniel Crocker wrote:
Is there a tool that will reformat PHP code the way "indent" does for C code? This code is a real mess in places.
-- Lee Daniel Crocker lee@piclab.com http://www.piclab.com/lee/ "All inventions or works of authorship original to me, herein and past, are placed irrevocably in the public domain, and may be used or modified for any purpose, without permission, attribution, or notification."--LDC _______________________________________________ Wikitech-l mailing list Wikitech-l@ross.bomis.com http://ross.bomis.com/mailman/listinfo/wikitech-l
On mer, 2002-05-01 at 17:07, Lee Daniel Crocker wrote:
The attached context diff contains fixes for the source file wikiPage.php, with these changes:
Great! But the attachment seems to have fallen out...
- Now accepts "JPG", "PNG", etc., in uppercase as image names. No longer accepts "tif" or "tiff"--that's not an appropriate format for web images, so they'll just be rendered as links.
Sounds good to me.
- Removes HTML comments from wiki text before rendering, so they can be used to leave comments _about_ the wiki text.
Not entirely unreasonable, but has this been discussed on wikipedia-l and/or the wiki?
- Major reworking of the code that handles p/pre/ol/ul/dl. Old code basically ripped out and replaced; now produces clean HTML, compact dls, handles nesting better, etc. I've tested this pretty extensively on my own server without problems, but it is a major change, so you might want to schedule installation for a time when Jimbo or Jason is available to roll it back if I missed something.
Sounds wonderful!
Is there a tool that will reformat PHP code the way "indent" does for C code? This code is a real mess in places.
"indent" might work all right on PHP; but then again it may not, I haven't tried it. I don't know of a specific tool.
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org